Modifying doc info on PDF converted from XPS

Q:

I am using PDFTron command line tool XPSConvert to convert XPS to PDF and I was wondering if it is possible to add certain document information to the final PDF?

I would like to be able to add a title and Author to the document.

It would be perfect if I could also set the properties of how the PDF document will open, e.g. window size, and additionally determine that the title of the document should be shown in the title bar instead of the file name.

A:

You can’t make any edits with XPSConvert CLI, however if you can achieve what you are looking for with PDFNet SDK with Convert Add-on (http://www.pdftron.com/pdfnet/addons.html#Convert).

Specifically:

using (PDFDoc doc = new PDFDoc()) {

pdftron.PDF.Convert.FromXps(doc, “my.xps”)

PDFDocInfo info = doc.GetDocInfo();

info.SetAuthor(“Joe Doe”);

info.SetSubject(“My subject”);
// …

doc.Save(“out.pdf”, 0);

}