We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

EssentialPDF : Cannot save to the same opened file!

Thread ID:

Created:

Updated:

Platform:

Replies:

55563 Jan 31,2007 11:05 PM UTC Feb 2,2007 01:43 PM UTC Windows Forms 3
loading
Tags: PDF
Richard
Asked On January 31, 2007 11:05 PM UTC

I did this in VS2005 C#:

PDFDocument docA = new PDFDocument("C:\\docA.pdf");
PDFDocument docB = new PDFDocument("C:\\docB.pdf");

foreach (IPDFPage page in docB.Pages) {
docA.Pages.Insert(0, page);
}

docA.Save("C:\\docA.pdf");


I get an I/O error saying that docA.PDF is in use by another process. Question: how can I open an existing PDF, modify it and then save it?

Thanks,

Richard

Dhivya K [Syncfusion]
Replied On February 1, 2007 01:40 PM UTC

Hi Richard,

Thank you for the code snippet. I was able to reproduce the issue. The problem is, you are saving the file with the same name that of the source file name which is being used. Can you please change the file name in save statement? This is same as modifying the existing document.

Here is a sample for your reference:
merge.zip

Please take a look into it and let me know if you have any other queries.

Regards,
Dhivya.

Richard
Replied On February 1, 2007 02:46 PM UTC

Thanks for your reply. The logic I expected is that you could:

a) Open an existing PDF document
b) Make some modifications to it (add pages, bookmarks, Title, etc)
c) Save it

This is the common behaviour of most applications. In MS-Word for example, you are not required to "Save As..." under a new file name every time you make a change! You just "Save".

Maybe you should add an overload Save() with no parameters that saves the document to the same file it was opened?

Richard

Dhivya K [Syncfusion]
Replied On February 2, 2007 01:43 PM UTC

Hi Richard,

Thank you for the information. Currently it is not possible to save a document with the same name. Instead we create a new PDF document with the existing content. I have forwarded this feature request to our development team regarding their thoughts on this overload.

Please let me know if you have any other queries.

Regards,
Dhivya.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;