Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jul 11, 2023 11:33 pm

Hi there,
I am after some clarification please on the parameters for ToPdfParameterList.

1. UsPSConversion - what does this do explicitly please? Recently on deploying to a new server, PDF conversion was failing and I found using this setting as on Azure (even though its a new AWS Windows instance) I have to set this to true for conversion to work. At a guess it uses PostScript, does it limit fonts or formatting at all please?

2. IsEmbeddedAllFonts - If we set this to true, do we need to provide the list of embedded fonts using a Private Font Path array or does the convertor gather this from the word document styles? Is there maybe an example (i see How-to-embed-uninstalled-fonts-by-font-document-when-convert-word-to-PDF.html) I'm just confused by both IsEmbeddedAllFonts and EmbeddedFontNameList.

Thanks for your help,
Steve

wortho555
 
Posts: 2
Joined: Tue Jun 27, 2023 9:43 pm

Wed Jul 12, 2023 9:44 am

Hi Steve,

Thank you for your inquiry. Allow me to address your questions:

Regarding the first issue: By setting the parameter "UsePSCoversion" to true during conversion, the process will not rely on GDI+ as Azure does not support GDI+. This is why the conversion fails when the parameter is not set. By enabling this parameter, the conversion should proceed successfully. we recommend updating to the latest version of our product. After updating, please refrain from setting the "UsePSCoversion" parameter and see if the issue persists. Our development team anticipates deprecating this parameter in future releases.

As for the second issue: When "IsEmbeddedAllFonts" is set to true, all fonts used in the document will be embedded in the resulting PDF. This ensures that clients who view the PDF do not experience any font-related issues or garbled text if they do not have the specific fonts installed on their systems. The "EmbeddedFontNameList" parameter allows you to specify certain fonts for embedding.

I hope this clarifies the functionality for you. Should you require further assistance or have additional questions, please don't hesitate to reach out to us.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Jul 12, 2023 10:10 am

Hi Triste,

Hey that’s all excellent information thank you.

I will do a test with the latest version and not using PS to see how that goes, thanks for the advance note on depreciation of this flag.

For the fonts, I’m still not 100% clear.
Are the flags mutually exclusive, or do I need to set embed to true AND provide the font files? Like, do I need to loop through my supported font list and included them?
Or, can I just set this to true and fonts are picked up from the StyleParts XML?

Thanks again,
Cheers,
Steve

wortho555
 
Posts: 2
Joined: Tue Jun 27, 2023 9:43 pm

Thu Jul 13, 2023 3:29 am

Hi Steve,

Thanks for your feedback.
If your system installs the fonts used in the document, then you don't need to set a separate private font path. Otherwise, you will need to install or specify a font folder to ensure that the fonts in the document are all correct. When our product processes text, if it can't find the font used, it will look for a similar font to replace it, and if it still can't find one, it will throw an exception. Embedding fonts is to guarantee that there will be no font problems when opening on all devices

I hope my explanation will be of use to you

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc