Converting html to pdf is throwing an exception

57 views
Skip to first unread message

Ryan

unread,
Nov 10, 2015, 5:49:01 PM11/10/15
to PDFTron PDFNet SDK
Q: We get the following error when converting html to pdf

Exception:
                 
Message: An error occurred while converting the file.
Detailed error:
               
Permission to access registry is required
               
Conditional expression: false
               
Filename   : Convert.cpp
               
Function   : trn::PDF::Convert::ToPdf
               
Linenumber : 1744
-    at pdftron.PDF.Convert.ToPdf(PDFDoc in_pdfdoc, String in_filename)

-----------------------------------------------------------------------------------------------------

A:

This error occurs, because our virtual printer is being used as part of the conversion process, and for this to work PDFNet needs read/write access to HKCU, (or HKCR).

Note that this is not the only way to convert HTML to PDF. If MS Word is installed that will be used instead of the virtual printer, or if our HTML2PDF module is made available to PDFNet (see https://groups.google.com/d/msg/pdfnet-sdk/E7Vag8bHGzc/zevegGu7Dl4J)

It is suprising that your client cannot read/write to HKCU, that is typically allowed, so if they can fix that everything should work.

Otherwise, and assuming MS Word is not installed, then packaging HTML2PDF module should solve the issue. The HTML2PDF module is available here, and our SDK includes a HTML2PDF sample.
https://www.pdftron.com/pdfnet/downloads.html

Please let me know if this works for you, and if you have any further questions.



Reply all
Reply to author
Forward
0 new messages