Free Support Forum -

Pdf document has 2 pages in browser


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?


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.