No announcement yet.

Extracting and replacing images in a PDF

  • Filter
  • Time
  • Show
Clear All
new posts

  • Extracting and replacing images in a PDF

    I'm trying to extract the scanned page images from a PDF. I also need to change document properties like Author. However I can't seem to get any page elements or locate any images.

    The following code successfully creates a new document based on an existing document with the Author name changed to "Samson". However when I try to get a count of the elements on the first page, I get an error because there are zero elements on that page. When I save the document the Author name is correct ("Samson").

    PdfDocument pdfDoc = new PdfDocument(@"c:\test.pdf"); MergeDocument doc = new MergeDocument(); doc.Append(pdfDoc); doc.Author = "Samson"; Page page = doc.Pages[0]; //message box shows elements count = 0 zero MessageBox.Show("elements count: " + page.Elements.Count.ToString()); //error occurs here PageElement pE = page.Elements[0]; doc.Draw(@"C:\testmerged.pdf");
    Where am I going wrong? Many thanks for any guidance.

  • #2
    Dear ChuckBud,

    Thanks for your post.For SDK questions or problems,please help to mail to directly and our SDK engineers will further help you via email.