PDF converted from Word not loading in Google Chrome

Hi
On Google Chrome, the PDF file converted from word is not loading even when using Adobe Reader insead of Chrome PDF viewer.
This is happening for PDF generated using Aspose.Words for .NET .
Please advise us on how to fix this issue?

Programming for multiple browsers is getting tougher every day. T-Mobile’s account log-in does not work in FireFox. Neither does the EFTPS (payroll tax collection system) of the IRS. These are 2 very big outfits, and they can’t even deal with multiple browsers. Every time I have to use log-in on those sites, I have to use IE. Good luck! (IMO, I’d as soon everybody just picked one and went with it. It would save all the programmers a lot of hassle.)

Hi
Raja,

Thanks for your query. I have tested the scenario and have not found any issue with output PDF file rending in Google Chrome while using latest version of Aspose.Words for .NET. I have tested the scenario with both Adobe Acrobat Viewer (Adobe PDF Plug-In) and Chrome PDF Viewer.

Please use the latest version of Aspose.Word for .NET. If you still face problem, please share your document for investigation purposes.

Thanks for the quick reply.
I tried with the latest version of Aspose.Words for .NET (10.7) but i am still having the same problem.
This is what I did. I went Chrome://plugins and disabled the Chrome PDF Viewer. We updated the Adobe Acrobat to latest version 10.1.4.38.
The PDF converted from word is not loading. Instead I see the progress bar icon “Initializing…” and it stays like that forever. Attached is the screenshot.
I also tried enabling Chrome PDF Viewer and opened the PDF. No luck as well. Attached is the screenshot.
I appreciate your input.
Regards
Rajendra

Hi Rajendra,

Thanks for sharing the information. It seems that this issue is related to Google Chrome not with Aspose.Words. To check this issue, please load some other PDF files (Not generated by Aspose.Words) in Google Chrome. I am using Google Chrome (21.0.1180.89m). Please share the version of Google Chrome which you are using.

It would be great if you please share your MS Word document for investigation purposes.

Attached is the word document.
Just give you a brief intro of what we are doing. We have correspondence created from a fat client in Microsoft word 2003. We are using Aspose.Words for .NET to convert these word documents into PDFs and expose them on the web.

The google chrome version on my machine is Version 22.0 .1229 .79 m

We are able to open other PDFs in Chrome. Those PDFs are dynamically generated using another software. They are not word converted.

Please share with us on what you find on your end with the PDF converted from the attached word document.

Regards
Rajendra

Hi Raja,

Thanks for sharing the information. I have tested the scenario with Google Chrome version 22.0.1229.79 m and Aspose.Word for .NET 11.7.0. The output PDF file has successfully loaded in Google Chrome version 22.0.1229.79 m. Please use latest version of Aspose.Words for .NET 11.7.0. I have attached the output PDF file with this post. Please check the attached image file for details.

Please load the attached PDF file in Google Chrome at your side and share your findings with us.

Thanks for checking on your end.
I did some research online and it turns out having this line of code fixed the issue on our end

// This is a must for Chrome
Response.AddHeader("Content-Length", fileBufferPDF.Length.ToString());

But what I also found out is adding this line of code is taking 15 secs to load the document converted from word to PDF using Aspose in the browser window.
Could you share your code? Please note that documents are retrieved from file server that might add little bit to the response time.
Regards
Rajendra

Hi Rajendra,

Thanks for sharing the information. Please use the following code snippet for your requirement.

https://reference.aspose.com/words/net/aspose.words/document/save/

Document doc = new Document("D:\c1990109.doc");
// Send the document in Word format to the client browser with an option to save to disk or open inside the current browser.
doc.Save(Response, "AsposeOut.pdf", ContentDisposition.Inline, null);