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

Free Support Forum - aspose.com

Save PDF file with overwrite existing

Hi,

I am working on a requirement for an existing client. They are already using Aspose. I am generated PDF through code using Aspose.Pdf.Dcoument class object. I can save the file onto specified location on disc using .save() method of above class, however if the file already exists on that location, I still want that to be overwritten with latest information.

I cannot see this happening with current code, is there anything additional need to be set regarding overwrite existing?

Thanks

Umer

Hi Umer,


Thanks for your inquiry. Please double check whether user running the application/code has write privileges on the file/folder, as to overwrite existing file user should has write privileges only. If issue persist then please share the code and error message, we will look into the scenario and will guide you accordingly.

Best Regards,

Hi Umer,


Adding more to Tilal’s comments, I have tested the scenario using following simple code and I am unable to notice any issue. The PDF file is properly being saved.

[C#]

Document doc = new Document(“c:/pdftest/TestPdf.pdf”);<o:p></o:p>

doc.PageInfo.IsLandscape = true;

doc.Save("c:/pdftest/TestPdf.pdf");

Hi,

Thanks for coming back it is fixed now. There was nothing wrong from coding point of view.

Regards

Umer

Hi Umer,


Thanks for your feedback. It is good to know that you have managed to resolve your issue.

Please keep using our API and feel free to ask any question or concern. We will be more than happy to extend our support.

Best Regards,