Hi team,
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 5.3.0.0 for Aspose.Word and the 3.8.0.0 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 9.1.0.0 and the Aspose.PDF 4.4.0.0 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 9.1.0.0 and the Aspose.PDF 4.4.0.0 products.
Aspose.Words.Paragraph par = new Aspose.Words.Paragraph(srcDoc);
Run run = new Run(srcDoc, _strWaterMark);
par.AppendChild(run);
shape.AppendChild(par);
run.Font.Size = _intFontSize;
run.Font.Bold = _blnBold;
run.Font.Color = System.Drawing.ColorTranslator.FromHtml(_strColor);
builder.MoveToHeaderFooter(Aspose.Words.HeaderFooterType.HeaderPrimary);
builder.InsertNode(shape);
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 9.1.0.0 and the Aspose.PDF 4.4.0.0 products.
Thanks a Lot!, we will be outstanding to your feedback in order to find a solution.
JHenao