PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun May 12, 2024 2:19 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Feb 11, 2011 3:22 am 
Offline

Joined: Fri Feb 11, 2011 3:08 am
Posts: 1
I need to modify the title property of a lot of pdfs automatically. I tried successfully to modify the title with the following code:
Code:
PdfDocument document =  PdfReader.Open(dest_file, PdfDocumentOpenMode.Modify);
document.Info.Title = filename;
document.Save(dest_file);


As you can see, this would open a file, modify the title of it and then save it back over itself. While the title did change, it also made all of the pages portrait. As the original files have a mixture, we ended up with all of the pages that were landscape being saved as portrait. This was made worse due to the content of the page not being rotated to fit, but only filling the top part of the page, and having the right hand side chopped off.

Is there a way to modify this metadata without opening and saving the pdf? - Ideal solution. (I believe I have seen programs that can do this, but I need to do it in bulk with a program already writen in C#.)

Failing that, can I open it without any modifications taking place to the pdf document layout and content, so I can just change the title?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 101 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group