We have a problem with the images in a PDF document after this are converted from a word document. The problem consists in that the images are not displayed and instead and “x” image are showed.
About the context execution and experiences:
Our implementation scenario consist in a SharePoint Solution, the conversion are realized in an “ItemUpdated” event handler taking the last published stream associated to the document to proceed with the conversion to pdf.
Based in our evidences and experiences we thing that this is a particular bug that occurs in this particular execution environment. Because as a part of our tests, we have constructed and windows app (with the same code snippet to convert) in order to realize the conversion and this problem doesn’t occur.
Additionally, during the construction of this solution we had experience other atypical problem that in the same way only was occurred under this context execution and in the test app it worked. This problem was an error during the load of the document object in the conversion process, specifically the problem occurred in the load of the Word Object:
Document srcDoc = new Document(streamDoc);
throw “Exception: The document appears to be corrupted and cannot be loaded”
This last error ocurred using the product versions 220.127.116.11 for Aspose.Word and the 18.104.22.168 for the Aspose.PDF, and after discard many possible reasons and modify the implementation trying to fix this with failed results, we update the solution to use the Aspose.Words 22.214.171.124 and the Aspose.PDF 126.96.36.199 products (the most recent versions when we test) and that issue leave to appear without change the implementation, just refreshing the assemblies and recompiling.
Finally, We saw other problem adding a text to the word document before to convert, the text inserted by the code snippet below is not showed. This problem occurs with the version of Aspose.Words 188.8.131.52 and the Aspose.PDF 184.108.40.206 products.
Aspose.Words.Paragraph par = new Aspose.Words.Paragraph(srcDoc);
Run run = new Run(srcDoc, _strWaterMark);
run.Font.Size = _intFontSize;
run.Font.Bold = _blnBold;
run.Font.Color = System.Drawing.ColorTranslator.FromHtml(_strColor);
By the foregoing we are depending on your support help to solve this problems. Attached is:
- DECRETO-2010-DECGGL-253.docx Source document.
- DECRETO-2010-DECGGL-253.pdf Result document with problems
- convertedfromdesktopapp.pdf Converted from testing desktop app with ok image.
- sharepointcodesnippet.txt Code snippet from the method used to convert for reference.
- sharepointcodesnippet.txt Code snippet from the method used in the test app, is an copy of the previous with some modifications, he is not in sharepoint context.
For this conversions are used the Aspose.Words 220.127.116.11 and the Aspose.PDF 18.104.22.168 products.
Thanks a Lot!, we will be outstanding to your feedback in order to find a solution.