Issue rendering PPT to PDF

Hello,

While rendering a PPT presentation to PDF, Aspose.slides produced garbled output with a large part of information missing. Please find attached both the original PDF and resulting PPT.

Rendering Java code is simple:
pptPdfSaveOptions = new PdfOptions();
pptPdfSaveOptions.setCompliance(PdfCompliance.PDF_A_1_B);
Presentation pres = new Presentation(contentStream);
pres.save(targetFileName, SaveFormat.Pdf, pptPdfSaveOptions);

Please advise how to change this code in order to achieve successful rendering.

Many thanks,
Dmitry



Hi Dmitry,

I have worked with your presentation file using Aspose.Slides for Java 17.5 on my end in Windows 7 with JDK 1.7 environment. I have not been able to observe any missing text in exported PDF. However, I have observed text blurring for table on last in exported PDF. An issue with ID SLIDESJAVA-36429 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

We are sorry for your inconvenience,

Hi Mudassir,

Thanks for the feedback.
Did you have a chance at the attached PDF generated by us?
In that document there are several pages completely missing, which is more serious than blurring. Please advise how we can overcome the issue with missing pages.

Thanks,
Dmitry

UPDATE: I just regenerated the PDF with Aspose.Slides 17.4 (the latest
available on the download page). The result is the same - PDF is really
broken, several pages are blank. It looks exactly like the attached PDF.
Please advise. Perhaps we can start with me running the test with Slides 17.5, same version as yours? Please make it available to me if possible.


Hi Dmitry,

I have observed your blank PDF results. Therefore, I suggest you to please try using Aspose.Slides for Java 17.5 on your end. The only issue that I have observed has already been logged in our issue tracking system. If you find missing text issue with Aspose.Slides for Java 17.5 as well then please share Operating System and Java details as well along with generated PDF.

Many Thanks,

Hello Mudassir,

I am glad to try Aspose.Slides 17.5, but it is not yet available for download via Aspose website.
Please share a download link for 17.5, and I will try and send you feedback.

Many thanks,
Dmitry

Hi Dmitry,

Please proceed to this download section link in order to download Aspose.Slides for Java 17.5 on your end.

Many Thanks,

Hi Dmitry,

I have observed your results and like to share that the issue is not with API when rendering to PDF as I have been able to export the presentation to PDF without missing content. Can you please share the Operating system and Java details on your end. Moreover, I have observed following fonts have been used on your end.

  • Arial
  • Calibri
  • Wingdings
  • Imago Book
  • MS PGothic
  • Imago
  • MS Pゴシック

Please make sure all fonts are installed on your machine or you may load these fonts externally in your application without even installing them by following these guidelines.

Many Thanks,

Hi Mudassir,

Thanks, will check out the fonts issue.

Java: 1.7
OS: Linux RHEL 6.3

Regards,
Dmitry

Hi Dmitry,

Please perform the suggestions related to fonts on your end and if there is still an issue then please share further feedback with us.

Many Thanks,

Hi Mudassir,

I confirm that embedding fonts by hand made things better. Thanks for your guidance.
Now I think I see exactly the same issue that you see related to content blurring and overlap (attached).

Thanks,
Dmitry


Hi Dmitry,

I have used following sample code on my end to generate the PDF. It is the same code that you have shared with us. As far code sample for loading external fonts is concerned, I have already shared the documentation article, Loading Fonts from External Directories link with you in my previous post.

public static void TetPdfExport()
{
String path="C:\\Aspose Data\\";
PdfOptions pptPdfSaveOptions = new PdfOptions();
pptPdfSaveOptions.setCompliance(PdfCompliance.PdfA1b);
Presentation pres = new Presentation(path+"Reference Guide_part.pptx");
pres.save(path+"Reference Guide_part.pdf", SaveFormat.Pdf, pptPdfSaveOptions);
pres.save(path+"Reference Guide_part2.pdf", SaveFormat.Pdf);

}


I hope the shared information will be helpful.

Many Thanks,

Hi Mudassir,

Thanks for sharing the code.
As my previous update, I now see the symptoms that you see and that are described in SLIDESJAVA-36429. I have to add that next to blurring and overlapping text, rendering of this PDF is abnormally slow and takes a few minutes. Please also include this information into the ticket.

Could you please provide an estimate as to when do you think we can expect a fix for this issue?

Thanks,

UPDATE: We expanded our font cache. After this we observe a strange issue: rendering has become extremely slow, a PPT with 3 slides in it takes 36 minutes to render!
14:01:12,505 DEBUG [http–0.0.0.0-9080-1] com.roche.etmf.integration.util.PdfRenderer - BEGIN - ppt2Pdf
14:37:21,862 DEBUG [http–0.0.0.0-9080-1] com.roche.etmf.integration.util.PdfRenderer - END - ppt2Pdf
Also rendering result is garbled again(see attached). It looks like adding more fonts makes the alorithm unstable.



Hi Dmitry,

I have observed the shared PDF as well as your comments. When I have opened the shared PDF, I am able to observe the text but all text is improperly rendered. This is a separate issue and is not linked to SLIDESJAVA-36429. The issue SLIDESJAVA-36429 deals with text getting blurred for table on slide 4. However, in your case the text is appearing completely wrong on all slides.

An issue with ID SLIDESJAVA-36436 has been created in our issue tracking system to further investigate and resolve the issue related to improper text rendering on all slides for generated PDF shared by you in your last post.


UPDATE: We expanded our font cache. After this we observe a strange
issue: rendering has become extremely slow, a PPT with 3 slides in it
takes 36 minutes to render!
14:01:12,505 DEBUG [http–0.0.0.0-9080-1] com.roche.etmf.integration.util.PdfRenderer - BEGIN - ppt2Pdf
14:37:21,862 DEBUG [http–0.0.0.0-9080-1] com.roche.etmf.integration.util.PdfRenderer - END - ppt2Pdf
Also rendering result is garbled again(see attached). It looks like adding more fonts makes the alorithm unstable.



I request you to please provide modified sample code after my suggestions that you have used to generate the PDF. Have you used FontsLoader class to load fonts or have done that some other way. Please share the complete information that how we may reproduce this and further investigate it.

Many Thanks,

Hi Mudassir,
Please find the source code:

String FONTS_REPO_FOLDER_JBOSS = “/opt/documentum/cs/shared/java64/1.7.0_17/jre/lib/fonts”;
String[] fontDir = new String[] { FONTS_REPO_FOLDER_JBOSS };

FontsLoader.loadExternalFonts(fontDir);

logger.debug(“fonts loaded.”);

Presentation pres = new Presentation(contentStream);
pres.save(targetFileName, SaveFormat.Pdf, pptPdfSaveOptions);

logger.debug(“presentation saved to PDF.”);
FontsLoader.clearCache();

I observed that fonts loading takes about 3 minutes, and rendering takes 30+ minutes, and result is incorrect, as shared earlier.

Many thanks,
Dmitry

Additionally: is there are more efficient way to load only required fonts? Loading entire fonts cache seems very inefficient.
Aspose.Pdf library has findFont method that can be called to load fonts needed only for specific document, maybe we can use this approach for the PPT as well?

Thanks,
Dmitry

Hi Dmitry,

Thank you for sharing the code. It is same as suggested. Can you please share the fonts that you are loading externally so that I may investigate this and log this in our issue tracking system.

Many Thanks,

Hi Mudassir,

Sorry, the fonts file is very large - 327 MB in zipped form, attaching doesn’t seem to work for such file sizes.This also explains why it takes the font manager so long to download all the fonts.
This is why I am asking: is there a better API that can load only the fonts needed for specific PPT?

Thanks,
Dmitry


Hi Dmitry,

I have observed following sample code line in your code where you are setting font load path. That is a too much to load as you are loading entire fonts registered with Java.


String FONTS_REPO_FOLDER_JBOSS = “/opt/documentum/cs/shared/java64/1.7.0_17/jre/lib/fonts”;


I suggest you to please load only required fonts in some custom directory and give its path to LoadExternalFonts. This would certainly improve performance on your end. Please copy only fonts used in your presentation (as shared by me with you earlier) in custom directory and then load them.

Many Thanks,

Hi Mudassir,

Sorry, but your suggestion will not work - I am not building software to render one presentation, but many different documents that contain various fonts. This is why for our needs it is necessary to maintain an extensive font repository.

Please bring my findings to the attention of Aspose engineers.
How can we have a hotfix delivered specifically for us?

Thanks,
Dmitry

Hi Dmitry,

If suggested approach is not suitable on your end then I request you to please share the fonts folder that you mentioned is of 300 MB. Our product team would require to test and verify the loaded fonts to find out which font or fonts are responsible for delay in rendering. Please provide the requested information so that I may log that in our issue tracking system for investigation and resolution. You may please zip and place fonts on some FTP server or google drive and share the download link with us.

Many Thanks,