We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Logo disappears when saved as a PDF

We have a word document (.docx) that has a logo on the top. We dynamically add content and create pdf’s. This has been working. Recently I needed to make some changes. I copied the docx file and renamed it. Now the logo is not showing up in the pdf but is still there in the docx file. I even commented out all the code so Aspose just opens the docx and saves it right to a pdf without doing anything to it and the logo is still missing.

Document doc = new Document(Server.MapPath("~/Portals/0/Client1/Doc2.docx"));
DocumentBuilder builder = new DocumentBuilder(doc); 
doc.Save(compound + ".pdf", SaveFormat.Pdf, SaveType.OpenInBrowser, Response);
return;

Any ideas?

Hi
Thanks for your request. Could you please attach your document here for testing? We will check the issue and provide you more information.
Best regards,

Hi Digitalman,
Can you please share word document.
Which version of Aspose.Words are you using?

Regards,
Imran Rafique

Version of dll is 2009.09.14

Hello
Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words for .NET 10.5.0. You can download this version from here:
https://releases.aspose.com/words/net
Could you please try using the latest version of Aspose.Words and let me know how it goes on your side.
Best regards,

Hi Digitalman,

Please follow this code to resolve your issue.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Hello world!!!");
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Pdf);
Response.Clear();
//Specify the document type.
Response.ContentType = "application/plain";
//Other options:
//Response.ContentType = "text/pdf"
//Response.ContentType = "text/html"
//Specify how the document is sent to the browser.
//Response.AddHeader("content-disposition","inline; filename=MyDocument.pdf");
//Another option could be:
Response.AddHeader("content-disposition", "attachment; filename=out.pdf");
//Get data bytes from the stream and send it to the response.
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();

Please try using latest versions of Aspose.Words.

Regards,
Imran Ranrafique

Well, it does work with the new version however my client will be sure to ask why he must pay for an upgrade when everything was working for so long. Hmmmm.

Hi
Thanks for your inquiry. In earlier version of Aspose.Words DrawingML objects were lost upon processing documents. In 9.4 we provide limited support of these kinds of content. Please see the following link for more information:
https://reference.aspose.com/words/net/aspose.words.drawing/
The current version of Aspose.Words is 10.5.0
Best regards,

Ahhh, Fixed it. Appears since I moved to Word 2010 the older version of the component doesn’t fully support it. I opened the new docx in Word 2007 and re-saved it and now the logo persists to pdf. All good now. Thanks.