I have tried to save my document in html, doc and pdf. See code below.
document.Save(@“c:\Temp\pdffile.pdf”, SaveFormat.Pdf);
document.Save(@“c:\Temp\pdffile.html”, SaveFormat.Html);
document.Save(@“c:\Temp\pdffile.doc”, SaveFormat.Doc);
I did not get any output in html or doc format. I only got the pdf output. See attached output from the above statements.
Hi,
which Aspose.Pdf Version do you use?
I have tried with v 9.8.0.0 (latest version) and all is fine.
Could you provide the source PDF file (or your code to generate the PDF document)?
I am also using the new version Aspose.Pdf 9.8.0.0 which now supports page overflow feature that was not working in prior release.
Hi Lawrence,
Here is the project to demo SaveOptions issue.
Hi Lawrence,
Thanks for sharing the sample project.
Please note that Aspose.Pdf for .NET supports the feature to generate PDF documents. It also provides the feature to load existing PDF files and render them as DOC/HTML and other formats. So as per your requirement, first, you need to save the output in PDF format, then load the recently created PDF into a separate Document instance and then try rendering the output in DOC and HTML format.
Please add the following code lines in the CreatePdf(XmlDocument xmlData)
method inside your project.
For your reference, I have also attached the resultant files generated on my end.
[C#]
// return pdf document memory stream
MemoryStream pdfMemoryStream = new MemoryStream();
// document.Save(@"c:\pdftest\pdffile.html", SaveFormat.Html);
// document.Save(@"c:\pdftest\pdffile.doc", SaveFormat.Doc);
document.Save(@"c:\pdftest\pdffile.pdf", SaveFormat.Pdf);
document.Save(pdfMemoryStream);
Document doc2 = new Document(pdfMemoryStream);
doc2.Save(@"c:\pdftest\pdffile.doc", SaveFormat.Doc);
document.Save(@"c:\pdftest\pdffile.html", SaveFormat.Html);
return pdfMemoryStream;
Thank you for your help. It appears that your code does work.
Hi Lawrence,