ABCpdf copy document properties

I am trying to copy a PDF using ABCpdf AddImageDoc . It doesn't look like any document properties (eg "/ Rotate") are copied. It looks like I need to copy these properties manually from the old document to the new one using the SetInfo method. For example:

foreach page...{
    newPdfDoc.Page = newPdfDoc.AddPage();
    newPdfDoc.AddImageDoc(existingPdfDoc, i, null);
    newPdfDoc.SetInfo(newPdfDoc.Page, "/Rotate", existingPdfDoc.GetInfo(existingPdfDoc.Page, "/Rotate"))
}

      

There are a bunch of these properties and I don't want to set them manually. Is there a way to copy all properties at once?

+2


source to share


2 answers


Think of Doc.AddImageDoc as a function to place a page from another document as an image. The Doc.AddImage feature set basically scales imported images to fit the current document's Rect property.

To combine PDF documents, use the Doc.Append method.



To copy or delete pages in a document, use the Doc.RemapPages method .

+4


source


ABCPdf doesn't have an iterator for PDF properties



So, if you don't know all the property names you want to transfer, you will need to use a different tool to get the property names. You can use PDFsharp library to read any low level PDF files.

+1


source







All Articles