We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

PPT(X) to PDF: Text are missing and only slides background is rendered while using GroupDocs.Conversion 21.10

Hi Team,
We are using GroupDocs.Conversion for 21.10 for converting different formats to pdf in java. We observed that while converting ppt(x) to pdf, the texts are missing and only slides background is rendered with no texts at all.

This works fine on Windows machine however fails on integration environment where we are using Linux system. Could it be the issue of missing fonts in Linux system?

Let us now how we can provide the custom fonts during runtime for ppt(x) to pdf conversion.

Thank you
Rajesh chourasiya

1 Like

@ChourasiyaRajesh

You can set font directory using ConverterSettings class.

ConverterSettings converterSettings = new ConverterSettings();
converterSettings.setFontDirectories(Collections.singletonList(new File("custom_fonts").getAbsoluteFile().getCanonicalPath()));
Converter converter = new Converter("Input.pptx", converterSettings);
PdfConvertOptions options = new PdfConvertOptions();
converter.convert("Output.pdf", options);    

Or you can set Presentation file’s load option like this (depending on your requirements).

Hi @Atir_Tahir
Thanks for your reply. We went through the provided option and link to set the load options for Presentation and tried applying the changes. However, the behavior is same and works in Windows nut not in Linux environment. Additionally, we tried to set the custom font through GraphicsEnvironment also. Below is the sample conversion code we are trying and attached snapshot of the converted pdf file (image.jpg, 2nd slide snapshot)

image.jpg (86.2 KB)

The screenshot of original pptx file is also attached for reference (SamplePptxScreenshot.png)
SamplePptxScreenshot.jpg (233.0 KB)

Code snippet:

    try {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Resource resource = new ClassPathResource("font\\DejaVuSans.ttf");
        ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, resource.getInputStream()));
    } catch (FontFormatException | IOException e) {
        e.printStackTrace();
    }
    PresentationLoadOptions loadOptions = new PresentationLoadOptions();
    loadOptions.setDefaultFont("DejaVu Sans");
    final Converter converter = new Converter(new ByteArrayInputStream(sourceBytes), loadOptions);
    final PdfConvertOptions options = new PdfConvertOptions();
    final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    converter.convert(outputStream, options);
    return outputStream.toByteArray();

samplepptx.zip (395.4 KB)

Hi @Atir_Tahir we tried below case as well:

  1. Created a sample .docx file and .pptx file (no background) with Arial font and tried to run conversion on Linux integration environment.
    The docx file shows proper conversion as expected however the pptx conversion was totally blank.

Again, both the conversion works well on Windows system only.

Let me know in case of any other alternative ways to resolve this case.

Thank you

@ChourasiyaRajesh

Please share following details and we’ll further look into this issue:

  • Sample application using that issue could be reproduced
  • Linux environment details (e.g. OS version, flavor)
  • Problematic, expected and the converted files

You can also observe the font difference, compare the wrongly converted PDF (on Linux) and the correctly converted PDF (on Windows).
e.g. Open the PDF (in any PDF viewer), go to the properties and check fonts.
Share the font differences with us as well.

Hi @Atir_Tahir

Not sure for the sample application. We are not saving the converted file anywhere, instead the converted byte stream is used to be viewed through pdf-viewer. The environment details are as mentioned below:

  1. Linux Environment:
  • NAME=“Red Hat Enterprise Linux Server”
  • VERSION=“7.9 (Maipo)”
  • ID=“rhel”
  • ID_LIKE=“fedora”
  • VARIANT=“Server”
  • VARIANT_ID=“server”
  • VERSION_ID=“7.9”
  1. Java:
  • OpenJDK 1.8.0_291
  1. Sample pptx file used to convert (samplepptx.zip) and attached screenshot of the converted view of one of the slide (image.jpg) is already attached/uploaded.

Thank you

We need a sample application in order to investigate this issue. Could you please prepare a simple console app just to reproduce the issue.

Hi @Atir_Tahir

Let us know if we can do a screencast in this case. Let us know your feasible time, we will book your calendar.

Thank you

@ChourasiyaRajesh

Please share a sample application. We’ll investigate that at our end. Also note that all free support issues are handled/assisted on this forum.

Hi @Atir_Tahir
We don’t have any sample application available as such as of now and the environment code is all integrated. Creating a sample application with all environment dependencies will take another good time. Since, we are in the approval phase of license purchase, we would like to confirm our decision early.

Please let us know if we can do a screencast and will show the Groupdocs Conversion integration in our application and expected/actual results at runtime. We will try any suggestions provided which could help us to resolve this issue.

Thank you

@ChourasiyaRajesh

Please share a detailed screencast/video that must show the issue. We’ll then further look into this scenario.

Hi @Atir_Tahir
Due to some restrictions, we cannot upload the screencast of application (or any file/zip) from private network. We request you to provide any email id OR support inbox email id where we can send all the details along with the screencast.

Thank you
Rajesh Chourasiya

@ChourasiyaRajesh

We sent you a private message. Please share details in reply.

Hi @Atir_Tahir

Have replied. Please let us know.

Thank you

@ChourasiyaRajesh

Alright.