Question:I am searching for methods or libraries to VeryPDF?of a PDF file. I want to write a program and I need this option in this program. Perhaps you have some samples for c#. Is there any solution on
Answer: When you need to VeryPDF Advanced PDF Tools SDK, by which you can by two methods. Meanwhile the SDK version provides libraries to edit metadata of a PDF file. One method is that you can edit metadata by editing title, author and others separately and the other is editing metadata by output metadata to XML file and then edit them in XML file. After editing, you can import XML file back to PDF file. Please get more information of this software on homepage, in the following part, I will show you how to use this software.from C#, maybe you can have a free trial of this software
- Please download the SDK version as there are some code templates of calling this software from other programming languages.
- When downloading finishes, please extract it to some folder then you can call it from C# more easily.
Step 2. Edit metadata from C#.
- When you need to edit metadata from C#, you may need the following parameters, please have a check.
- Now let us check how to call it from C#.
-t "Title" : Set title
-a "Author" : Set author
-s "Subject" : Set subject
-k "Keywords" : Set keywords
-d "CreatedDate" : Set create date
-m "ModifyDate" : Set modify date
-c "Creator" : Set creator
-p "Producer" : Set producer
-D : Write document summaries into PDF file in ASCII
-e "MetaData" : Set MetaData, select a XML file for set metadata or "" to clear metadata
Here are some code templates:
pdftools -i c:\input.pdf -e "c:\metadata.xml"
pdftools -i c:\input.pdf -o c:\out.pdf -t title -s subject -l c:\err.log
pdftools -i c:\input.pdf -t title -a author -k "123,456" -d "2003-11-11"
pdftools -i c:\input.pdf -k "+PDF Tools"
pdftools -i c:\pdfdir\*.pdf -o d:\ -s subject -k "book,rtf,doc,text,pdf"
int WINAPI VeryPDF_PDFTools(LPCTSTR lpCommand);
char *lpLicenseKey = "XXXXXXXXXXXXXX";
\" -i \"%s\" -o \"%s\"",
lpLicenseKey, "C:\\test.pdf", "C:\\_test.pdf");
int nRet = VeryPDF_PDFTools(szCommandLine);
Please note when you need to export XML file for editing metadata, please make sure import XML file back by the following command line template:
pdftools -i c:\input.pdf -o D:\out.pdf -e "c:\metadata.xml"
By this method, you can edit metadata from C# easily. During the using, if you have any question, please contact us as soon as possible.