Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Aug 20, 2015 11:09 am

Hi,

Currently evaluating the free version.
We have a simple application which loads a pdf template, populates the form fields with results from a database and then saves it as a new pdf file. I would like to change the document information in the new file to replace what was in the original template. I've followed the example code like this:

newPdf.DocumentInformation.Author = "Test Author";
newPdf.DocumentInformation.Creator = "Test Creator";
newPdf.DocumentInformation.Producer = "Test Prod";
newPdf.DocumentInformation.Subject = "TEST Subject";
newPdf.DocumentInformation.Title = "Test Title";
prior to .SaveToFile.

The form fields are all populated correctly but the document information hasn't changed it still is as per the original pdf.

Is it possible to change document information in existing documents or am I missing some code.
thanks

Ade
 
Posts: 5
Joined: Thu Aug 20, 2015 11:02 am

Fri Aug 21, 2015 2:16 am

Hello,

Thanks for your inquiry.
I have tested a document and I can change the document information. Could you please provide us your new pdf file here, or sent it to us ( support@e-iceblue.com) via email ? It would be helpful to investigate this issue.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Aug 21, 2015 10:51 am

Hello Betsy,

I sent the file by email.

I had to strip out commercial stuff not relevant to the Document Information query.

In checking this amend file I noticed if I removed all the information so they contained empty strings (no text at all) and then ran my code the document information changed.

If I left the document information text in the Author, Title etc etc and than run my code it didn't make any change. So it appears in my case it is not over writing existing document information text with the new details in my code.

In VS2010 debug mode if I put a break point after newPdf.SaveToFile() and check the newpdf.documentinformation in the Locals window it shows the Author etc having the amended details. When I open the new saved file in it still has the old details.

Hope this makes sense.
thanks

Ade
 
Posts: 5
Joined: Thu Aug 20, 2015 11:02 am

Mon Aug 24, 2015 2:07 am

Dear Ade,

Sorry for late reply as weekend.
Thanks for sharing your document. I have reproduced your issue and posted it to our Dev team. We will inform you when it is fixed.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Mon Aug 24, 2015 8:10 am

Hi Betsy,

many thanks

Ade

Ade
 
Posts: 5
Joined: Thu Aug 20, 2015 11:02 am

Tue Sep 08, 2015 6:37 am

Dear Ade,

Thanks for your waiting. The newest hot fix of Spire.PDF: Spire.PDF Pack(Hot Fix) Version: 3.5.34 has been released, in which your issue has been resolved. Please download it and then have a try.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.PDF