Hi when I convert a pdf that has tables to HTML it uses divs to create the tables.
… |
Hi when I convert a pdf that has tables to HTML it uses divs to create the tables.
… |
Hi Brian,
Sure see attached.
Hi Brian,
I
have tested the scenario and I am able to reproduce the same problem that table is represented by DIV tags, instead of standard Table HTML markup. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-39027. We
will investigate this issue in details and will keep you updated on the status
of a correction. We
apologize for your inconvenience.
However as a workaround, you may consider converting PDF file to Excel worksheet and then transform Excel file to HTML format using Aspose.Cells. For more information, please visit
Just checking is there any update on if you plan to support HTML tables when converting from PDF to HTML?
Hi Brian,
Hi,
I am using aspose-pdf version - 18.4.(Java). I am getting the same issue when converting pdf to html . Tables are coming as div. Do you have any updated version to solve this issue?
Please send us your source PDF and code. We will investigate your scenario in our environment, and share our findings with you.
Hi, I shared the code and Documents in private mail. Please have a look into it. Hope you will update me the issue asap
I have not received your email message in my inbox. Please share your email address which you have used to send the email. You can send a private message in this forum or create another private thread to share files.
public static void main(String[] args) throws Exception {
setLicenceForAspose();
convertpdfToHtmlintoSingleSource();
System.out.println("Completed");
}
/**
* Function set licence
* @throws Exception
*/
public static void setLicenceForAspose() throws Exception {
com.aspose.words.License wordLicense = new com.aspose.words.License();
com.aspose.pdf.License pdfLicense = new com.aspose.pdf.License();
// Create a stream object containing the license file
FileInputStream fstreamWord = new FileInputStream(LicencePath + "Aspose.Words.lic");
FileInputStream fstreamPdf = new FileInputStream(LicencePath + "Aspose.Pdf.lic");
//Set the license through the stream object
wordLicense.setLicense(fstreamWord);
pdfLicense.setLicense(fstreamPdf);
}
/**
* Function to convert Pdf to html. The html should be a single resource.
*/
public static void convertpdfToHtmlintoSingleSource() {
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(pdfPath + "pdfToHtmlSample.pdf");
com.aspose.pdf.HtmlSaveOptions newOptions = new com.aspose.pdf.HtmlSaveOptions();
// Enable option to embed all resources inside the HTML
newOptions.PartsEmbeddingMode = com.aspose.pdf.HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;
// This is just optimization for IE and can be omitted
newOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
newOptions.RasterImagesSavingMode = com.aspose.pdf.HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
newOptions.FontSavingMode = com.aspose.pdf.HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
// we can use some non-existing file name all real saving will be done in CustomerHtmlSavingStrategy
String outHtmlFile = htmlPath + "pdfToHtmlSample.html";
doc.save(outHtmlFile, newOptions);
}
pdfToHtmlSample.pdf (110.8 KB)
We managed to replicate the said problem in our environment. We have logged an enhancement ticket ID PDFJAVA-37758 in our issue tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.
Thankyou for your updates.
Is there any alternate solution for this?
There is no workaround at the moment. We will let you know in case of any other way round.