.doc to pdf changes font while .docx to pdf doesnt

Product: PDFNet and PDFTron.NetFramework.x64

Product Version: 9.2 on both. What ever the latest from nuget is

Please give a brief summary of your issue:
.doc to pdf changes font while .docx to pdf doesnt.

Please describe your issue and provide steps to reproduce it:
When using pdftron.PDF.Convert.StreamingPDFConversion font styles for .doc files are not respected. As soon as its a .docx everything is fine.

Create a new .doc file in word. Type in test text, can be anything. Make the text Times New Roman size 10 and save. Make sure its a .doc. Then run that doc though pdftron.PDF.Convert.StreamingPDFConversion and the output pdf will now be aerial font. This is the easiest way to see something is wrong however if you get more complicated, such as having footer page numbers disappear. This all doesn’t happen if the file is a .docx. Please provide a way I can send you the example document that is confidential.

Please provide a link to a minimal sample where the issue is reproducible:

        var file = File.ReadAllBytes(@"C:\Users\ScottBush\Downloads\sertifi.doc");
		using (var ms = new MemoryStream(file))
		using (var doc = new PDFDoc())
			var filterReader = new StreamAdapterFilter(ms);
			var options = new OfficeToPDFOptions();

			var conversionResult = pdftron.PDF.Convert.StreamingPDFConversion(doc, filterReader, options);
			doc.Save(@"C:\Users\ScottBush\Downloads\sertifi.pdf", SDFDoc.SaveOptions.e_linearized);

I was unable to reproduce. Attached is the DOC file I made using MS Word, and attached is the output I got, after modifying our PDFToOfficeTest sample using the code you provided above.

Ideally though Word files are saved with the Fonts embedded.

The next step would be to try our latest SDK

For additional resources on improving font support see this guide, in particular add the “self serve font package” and call the two APIs SetCustomWebFontURL and EnableDownloads

test_Word97.doc (26 KB)
test_Word97.doc_9.2.3-0cccf35a4e_windows.pdf (13.5 KB)

I Am able to reproduce with the file you provided. I see the link provided a dll for PDFNet however its dependency PDFTron.NetFramework.x64 was not provided so i can not test with anything besides what’s available on nuget.
test_Word97.pdf (11.1 KB)

Since the fonts are not embedded, you need to provide appropriate substitute fonts on the computer doing the conversion.

Did you try the steps I suggested earlier?

  1. Update to latest SDK
  2. Download Self server web fonts
  3. Add the two API calls
  1. yes i am now using
  2. from my understaning PDFTron hosts these for us
  3. the documentation at Class WebFontDownloader (pdftron.com) and PDFTron Systems Inc. | Documentation both show to be a public class to access and set enabling downloading of fonts however in practice that is not the case. Please see screen shots that dhow WebFontDownloader is not exposed.


Looks like the new version fixed my issue at hand. Doesn’t explain why I cant use ClassWebFontDownloader, but my original issue is solved with your push of to nuget.