Different layout on Linux and Windows


#1

Hi,

When I convert PPT to HTML and PDF to DOC, I found some result files have different layout between Linux and Windows. And that affect to our project when we try to extract text to count line and sentences.
Please advise how to fix it.
example.zip (2.2 MB)

Regards,
Rapeepan


#2

@rcomniscien,

Thanks for providing us sample files and screenshots.

We checked your provided files and screenshots. From images and presentation files, we could not evaluate your issue precisely. What is your actual requirement? Are you converting Slides->HTML->PDF->DOC, please elaborate and provide complete details? We also need to have sample code for this and intermediate outputs (if any) on different levels where the actual issue is occurring.


#3

@Amjad_Sahi

I have multiple file types and I need to convert them to text to count lines and sentences.

For PPT, I converted them to HTML ex. “KM Sem.ppt”->“KM Sem.html”
And for PDF, I converted them to DOC ex. “KM ABA.pdf”->“KM ABA.doc”
Then, I extracted the converted files (HTML and DOC) to text.

But I found some converted files got different layout depend on OS, Windows and Linux.
So when I extracted text from the converted files and counted lines and sentences, the result would be different too.

Here is my PDF sample file : KM ABA.pdf (267.6 KB)
And my code for ConvertPptToHtml :

com.aspose.slides.Presentation pres = new com.aspose.slides.Presentation(sInputFile);
pres.save(sTempFolder + sFileName + “.html”, com.aspose.slides.SaveFormat.Html);

for ConvertPdfToDoc :

com.aspose.pdf.Document pdfDoc = new com.aspose.pdf.Document(sInputFile);
pdfDoc.save(sTempFolder + sFileName + “.doc”, com.aspose.pdf.SaveFormat.Doc);

Regards,
Rapeepan


#4

@rcomniscien,

We have worked on your Powerpoint presentations for your issue regarding Aspose.Slides. We conducted tests using Aspose.Slides and exported them to HTML in Windows environment. There is no issue in the generated HTML files as we have compared the outputs.

As you are using Calibri font in your presentation files, so you need to check and make sure that if Calibri font is available in your Linux instance too. Otherwise, you may copy the Calibri font and load that externally in your application using LoadExternalFonts. See the document for your reference:
https://docs.aspose.com/display/slidesjava/Managing+Fonts#ManagingFonts-LoadingFontsfromExternalDirectories

Also, please find attached the output for your reference. Moreover, please notice an important thing regarding Calibri font issue with some JDKs. Its’ known Java problem. See the thread for your reference.


Presentation_HTML.zip (396.8 KB)

Regarding your issue with PDF, we will evaluate and get back to you soon.