Showing Error when converting Word 2003 to PDF

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v1)  /  Re: Showing Error when converting Word 2003 to PDF

DynamicPDF Converter for .NET (v1) Forum

1.Code sample or project using which we can recreate the behaviour.

 string extfilepath = this._AppBasePath + sExt + newFileName;  //.docx,.xlsx files
                                string pdffilepath = this._AppBasePath + sFinalFinal;  //.pdf (empty)

                                String continuationTemplate = "ContinuationTemplate.PDF";

                                MergeDocument objExtra = new MergeDocument(KPI.Global.Helper.Framework.GetFormTemplateFileNPath(continuationTemplate, State.sJurisID), new MergeOptions(true));
                                objExtra.Draw(pdffilepath);

                                if (Directory.Exists(_AppBasePath))
                                {
                                    File.WriteAllBytes(extfilepath, objPDFData);
                                    Converter.Convert(extfilepath, pdffilepath);
                                }
2.Sample input file using which you are seeing this behaviour.

System.Exception: Conversion failed ---> System.Exception: PrintOut returns 0x8001011F at p.b(i A_0, i A_1) --- End of inner exception stack trace --- at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions) at ceTe.DynamicPDF.Conversion.Program.a.b() at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0) at ceTe.DynamicPDF.Conversion.Program.a(Object A_0)

3.Operating System details: Name, x86 or x64.
x64

4.MS Office details: Version, x86 or x64 (if you are converting any MS Office file types to PDF).
x64 (converted the doc file format is 'Word 97-2003 Document'

5.Version of Internet Explorer which is installed locally (in case you are converting HTML or URL to PDF).
Internet Explorer 11

6.Are you able to convert simple text or images (JPEG or PNG) to PDF?
Yes, I'm able to convert JPG file & .txt file

7.Version and build number of the DynamicPDF Converter for .NET DLL file. You can get this information in DLL references properties (Version and Descriptions fields) in Visual Studio.
 DynamicPDF Converter v1.0.1 Latest Build 33698  'ceTe.DynamicPDF.Converter.40.dll'
VS 2013
Posted by a ceTe Software moderator
Hello,
 
Since the JPEG and text file are converting fine, this indicates that converter product is working fine.
 
You are getting error on MS Office file types to PDF conversions most likely because of using unsupported x64 MS Office. Please try installing the supported 32-bit MS Office 2016 and run the conversions. Please refer to the documentation on operating system requirements and limitations here.
 
Thanks,
ceTe Software Support Team.
Thanks for replying.

Tried like this,

In Other machine, I have Office 2013 32 bit , So created Document in that machine and used the same in my machine, the same error showing.

Thanks
Priya
In One Comment, I saw, It's Compatible with 2007,2010 32 bit. But it won't support 2013 32 bit?
Posted by a ceTe Software moderator
Hello,

Please refer to converter requirements for v1.0.1 build 33698 that you are using. It is supported only on 32-bit edition of MS Office 2016. We have not tested v1.0.1 build 33698 with older versions of MS Office so it may or may not work.

Try running the Converter on a machine that has 32-bit MS Office 2016 installed and if you are still unable to convert Office documents, email the latest error message and some sample word documents to support@dynamicpdf.com referencing this forum post and we will look into it further.
 
Thanks,
ceTe Software Support Team.
HI Team

Now I'm using 2016 32 bit MS Office with Windows 10 64 bit OS. Completed all my code. Changed the appropriate path in ceTe.DynamicPDF.Converter.Service.exe file also.
When converting the word to pdf, automatically created two temporary folder like pageGuid(random alphanumerics) folder & ttnyuszk.qyu(random) folder. after this, shows an error message like 'Could not find file " path/ randomnumber.pdf", then those two folders also automatically deleted.

mentioned the same path for
1.word
2.pdf
3.  .exe file path.

Kindly give me the solutions.

Thanks
Priya
Posted by a ceTe Software moderator
Hello Priya,
 
We will need to look into this issue further. Please send an email along with a link to this forum post and the following details to support@dynamicpdf.com.
1.        Sample Word documents using which you are getting error.
2.        Full error message along with stack trace.
3.        Code sample used to convert the files.
4.        Are you able to convert simple image (JPEG or PNG) and text files to PDF.
5.        MS Office details installed on the machine where in you are getting error: Version, x86 or x64.
6.        Operating System details where in conversions are running: Name, x86 or x64.
7.        Exact version and build number of the DynamicPDF Converter DLL file used in the application. You can get this information by right clicking on DLL file>> Properties>> Details tab>> Product version or take a screenshot of details tab and send it over to us.

 Thanks,
ceTe Software Support Team.
Hi, Thanks for replying. Whatever you are asking I sent this in the first Email itself. you are given the all input, I did that too, but still getting error.
Giving the details again, kindly review it and reply back asap.
1.        Sample Word documents using which you are getting error.
In document, just entered 'Test word' saved and close the doc.
2.        Full error message along with stack trace.
Message:
Could not find file 'path\3177191f-8837-4aa7-b2a8-5d46a7d81f30.pdf'.
Stack Trace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at ceTe.DynamicPDF.Conversion.Converter.a(String A_0, Boolean A_1)
   at ceTe.DynamicPDF.Conversion.Converter.Convert(String inputFilePath, String outputFilePath, ConversionOptions conversionOptions)
   at .LoadSelectedReports(Int64 incidentID, String selectedreports) in d:\full path.aspx.cs:line 837
3.        Code sample used to convert the files.
string    sOpenFile = sFTPhysicalPath + "/" + sFTPBaseFolder + "/"+ sFileName.Substring(sFileName.IndexOf("___") + 3);
 string  pdffilepath = sFTPhysicalPath + "/" + sFTPBaseFolder + "/" + sFinalFinal;
                                        
                                        Document document = new Document();
                                        currentPage = new ceTe.DynamicPDF.Page(pageDimensions);
                                        document.Pages.Add(currentPage);

                                        document.Draw(pdffilepath);
                                     

                                        byte[] bytes = System.IO.File.ReadAllBytes(pdffilepath);
                                        System.IO.File.WriteAllBytes(pdffilepath, bytes);

                                            Converter.Convert(sOpenFile, pdffilepath);
                                            byte[] byteqs = System.IO.File.ReadAllBytes(pdffilepath);
                                            System.IO.File.WriteAllBytes(pdffilepath, byteqs);
                                            arrRptList.Add(objPDFMgr.StorePDFBlobTemp(byteqs));

4.        Are you able to convert simple image (JPEG or PNG) and text files to PDF.
Yes. able to convert, jpg,png& txt files
5.        MS Office details installed on the machine where in you are getting error: Version, x86 or x64.
[ MS Office version: 2016 MSO (16.0.4266.1001) 32-bit],[ x86]
6.        Operating System details where in conversions are running: Name, x86 or x64.
[Windows 10 - 64-bit Operating System,x-64 based processor], [x86]
7.        Exact version and build number of the DynamicPDF Converter DLL file used in the application. You can get this information by right clicking on DLL file>> Properties>> Details tab>> Product version or take a screenshot of details tab and send it over to us.
Product Version: 1.0.1 (Build 33698)
Posted by a ceTe Software moderator
Hello Priya,
 
Thanks for the details. By default, Converter writes temporary files to ‘%WINDIR%\TEMP'  folder while converting HTML and MS Office documents. You are getting this error most likely because of lack of permissions on the temp folder. Please make sure to set the read and write permission on ‘%WINDIR%\TEMP' folder on your machine. If you have changed the temp folder path in ceTe.DynamicPDF.Converter.Service.exe.config to a different location, make sure that location has permissions. If this is a web application, make sure the user account under which your application is running has full permissions on the above folder.
 
Thanks,
ceTe Software Support Team.
Hi Team

Using Virtual machine path . My default path for word document, pdf, ceTe.DynamicPDF.Converter.Service.exe.config file are given as same.

Path: \\192.168.xx.xx\BulkUpload

This machine under our workgroup. Always have all Permissions to Read & Write the files. 

If permissions is the problem means, pdf converter's temporary folder with word  document are displaying when converting file. Kindly  read the previous message also.

Note:  When I append '@' for PDF file path in Converter.Convert(), showing message like "Unable to locate output path or access denied". If I not append '@' in pdf file path showing message like "Could not find file 'path\3177191f-8837-4aa7-b2a8-5d46a7d81f30.pdf'. "

I'm using these dll named as 'ceTe.DynamicPDF.Converter.40.dll' in my project reference. is this Correct?

Thanks
Priya
Posted by a ceTe Software moderator
Hello,

The temp file path \\192.168.xx.xx\BulkUpload you have specified in ceTe.DynamicPDF.Converter.Service.exe.config file is a network path and this is the reason you are getting the error "Could not find file 'path\3177191f-8837-4aa7-b2a8-5d46a7d81f30.pdf'”.

You can use a network path for input word document and for output PDF, but you cannot use a network path for temp folder that Converter uses, it has to be a local path i.e. local to the machine where the Converter is installed.

Update the tempFilesPath value in ceTe.DynamicPDF.Converter.Service.exe.config file to a local path, such as “D:\TempFiles” or something similar and make sure this path has read/write permissions. After you update and save the ceTe.DynamicPDF.Converter.Service.exe.config file, go to “Administrator > Services” and restart the DynamicPDF Converter service. After that, try running conversions from your application. 

Also, when using network paths for input and output file, please follow the example listed below:

Converter.Convert(@"\\192.168.xx.xx\BulkUpload\test.docx", @"\\192.168.xx.xx\ BulkUpload\Output.pdf");
 
Thanks,
ceTe Software Support Team.
HI Team,

 I'm not using network path now. Still not able to convert document to pdf. 

Installed Dynamic PDF converter in local machine. But I get the Doc file and pdf in Virtual machine. .exe file in local machine path

word file: //192.168.xx.xx/BulkUpload/test.docx
pdf file : //192.168.xx.xx/BulkUpload/output.pdf
.exe file path: D:/TempFiles

System.Exception: Conversion failed ---> System.Exception: PrintOut returns 0x8001011F

   at p.b(i A_0, i A_1)

   --- End of inner exception stack trace ---

   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)

   at ceTe.DynamicPDF.Conversion.Program.a.b()

   at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0)

   at ceTe.DynamicPDF.Conversion.Program.a(Object A_0)

Kindly give me the proper solution.

Thanks
PRiya

All times are US Eastern Standard time. The time now is 9:33 AM.