Convert.WordToPDF

199 views
Skip to first unread message

Steven

unread,
Mar 21, 2017, 3:28:15 PM3/21/17
to PDFTron PDFNet SDK
Using the WordToPDF feature to convert DOCX files into PDFs.
We are running on a web server that converts the documents and stores them.
Run good when testing on local machine.
When we publish to an Azure Web Site we get the following error:

Exception: 
Message: docx conversion failed: Cannot load font, and cannot find any fallback fonts.
Conditional expression: 
Filename   : FlowToPDFConversion.cpp
Function   : PDF::DocxConversion::Convert()
Linenumber : 95

Any suggestions on next steps.  Do i need to upload fonts to azure web site?  if so, are there a set of fonts that would cover use in most cases for the font/fallback fonts.

Thanks for any help or suggestions.

Ryan

unread,
Mar 23, 2017, 1:30:20 PM3/23/17
to PDFTron PDFNet SDK
Can you please download this command line tool

and run the following command on your azure instance.
office2pdf.exe file_path

If the command line tool works for you, but your code does not, can you please post your code.

Steven

unread,
Apr 6, 2017, 6:54:53 PM4/6/17
to PDFTron PDFNet SDK
I have loaded the exe to my Azure Web Site and tried to run it.  It gets the following error:

The evaluation version encountered an error in your system configuration
Please go to: pdftron.com/kb_eval_error No reg, write rights.

Since this is an azure website, i cannot get elevated privlages.  Any suggestions?

Steven

unread,
Apr 6, 2017, 6:54:54 PM4/6/17
to PDFTron PDFNet SDK
Did more investigation.  I wrote a small console app of my own that i could provide our key to get past the elevated rights.

Once i did this, i got the following message:

docx conversion failed:  cannot load font, and cannot find any fallback fonts.

I see you have a resource folder in the sample app you sent that had the following files:

pdftron_layout_resources.plugin
pdftron_smart_substituion.plugin

so i added this directory and set my WordToPDFOptions.SetLayoutResourcesPluginPath() and .SetSmartSubstitutionPluginPath() to this resources directory.

It worked.

So what are this .plugin files and do i need to create them to deploy to my azure web site?

Thanks for any help on this.


On Thursday, March 23, 2017 at 12:30:20 PM UTC-5, Ryan wrote:

Ryan

unread,
Apr 6, 2017, 8:34:46 PM4/6/17
to PDFTron PDFNet SDK
Thank you for posting information on getting trial mode to run on azure.

As for the font resources, our blog post introducing Word2PDF talks about this, but the detailed information is here.
Reply all
Reply to author
Forward
0 new messages