Pdf to html conversion

pdf is not converting into html properly.bellow is my code

let convertApi = conversion_cloud.ConvertApi.fromKeys(clientId,clientSecret);

    const loadOptions = new conversion_cloud.PdfConvertOptions();
    loadOptions.format = "pdf";
   
    convertOptions = new conversion_cloud.WebConvertOptions();
    convertOptions.fixedLayout = true;
    
    let result = await convertApi.convertDocumentDirect(new conversion_cloud.ConvertDocumentDirectRequest(input.toFormat, input.fileContent, undefined, undefined, loadOptions, convertOptions));

samplepdf.pdf (3.0 KB)

output.pdf (46.8 KB)

And Also ,If our PDF contains tables then in converted html table borders are not appearing

@Lokesh7351

I am afraid we are unable to notice the reported issue while testing the scenario with the latest version of GroupDocs.Conversion Cloud SDK for Node.js.
samplepdf.zip (46.1 KB)

// construct Api
const api = GroupDocs.ConvertApi.fromKeys(appSid, appKey);

//const convertOptions = new GroupDocs.DocxConvertOptions();
 
const file = fs.readFileSync("C:/Downloads/samplepdf.pdf");
const localPath = "C:/Downloads/samplepdf.html";

let loadOptions = new GroupDocs.PdfLoadOptions();
loadOptions.format = 'pdf';

// Html Convert Option
let convertOptions = new GroupDocs.WebConvertOptions();
convertOptions.fixedLayout = true;


try {
let request = new GroupDocs.ConvertDocumentDirectRequest("html",file,undefined,undefined,loadOptions,convertOptions);
let result = await api.convertDocumentDirect(request);

//console.log(result);    			    
fs.writeFileSync(localPath, result);
}

@Lokesh7351

Please share your input document with us for the investigation.

how we can add borders in each page .
sample.zip (46.3 KB)

@Lokesh7351

Please try the margin parameters of PdfConvertOptions as suggested in the following documentation. Hopefully, it will help you accomplish the task.

I m converting a pdf file into html not any file into pdf. The attached file i converted from groupdocs online converter(pdf to html).Here Borders are defining a specific page.
sample1.zip (47.4 KB)

@Lokesh7351

My apologies for the misunderstanding. Please set the fixedLayoutShowBorders property of WebConvertOptions to true for the requirements.

1 Like

While converting pdf to html . i m getting following error.how to resolve this issue?
{
message: ‘At most 4 elements (for any collection) can be viewed in evaluation mode.’,
code: ‘internalError’
}

@Lokesh7351

We are sorry for the inconvenience. I am afraid it is working fine at my end. Please share your sample document with us for investigation.