Free Support Forum - aspose.com

Pdf document has 2 pages in browser

Hello,

I use the following code to convert a generated word doc into a pdf and then display in the browser:

docLetter.Save(MapPath(".") + “…\Documents\MarkelLetter.xml”, SaveFormat.FormatAsposePdf)

pdfDoc.BindXML(MapPath(".") + “…\Documents\MarkelLetter.xml”, Nothing)

pdfDoc.Save(MapPath(".") + “…\Documents\MarkelLetter.pdf”)

pdfDoc.Save(“MarkelLetter.pdf”, Aspose.Pdf.SaveType.OpenInBrowser, Response)

When it is displayed the pdf has 2 identical pages.

However when I open the generated pdf file directly it correctly has only 1.

Why is this happening?

Dear XJGCYC,

Thank you for considering Aspose.

It seems strange and I have no idea. Can you please send me an example of your Word document and let me test it?

Seems to have been caused by the 2 calls to the Save method. I removed the first and all is ok now.