Remove Image Field

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Re: Remove Image Field

DynamicPDF CoreSuite for .NET (v7) Forum

 Apr 01 2013 5:29 PM
I'm trying to remove an image field from the PDF and it won't remove.  We have a barcode and that will remove.  Please see VB code below. 

' Code for removing the "Image Field" (not image) as this is the object name (type) in LiveCycle

Dim NewDoc As MergeDocument = New MergeDocument(strPDFTemplatePath)

NewDoc.Form.Fields.Remove(NewDoc.Form.Fields("ImageField"))

' This code above will not remove the Image Field from the PDF

' This code below will remove the BarCode from the PDF.  What gives?  The name in Livecycle (type) is "Barcode Field"

NewDoc.Form.Fields.Remove(NewDoc.Form.Fields("BarCode"))

The barcode object is removed, but the image field object is not.  Very weird.  Any insight.  Let me know if you need to see more code.

 Apr 02 2013 4:04 AM
Posted by a ceTe Software moderator
Hello,

Can you please send over the following details to our support team so that they can look into it further?

1.Input PDF document.
2.Output PDF document.
3.Exact version and build number of the DynamicPDF product.

Thanks,
ceTe Software Support Team.
 Apr 03 2013 1:04 PM
Posted by a ceTe Software moderator
Hello,

It is not possible to remove selected form fields from an existing PDF document. The remove method will remove the form field from the FormFieldList but not from the underlying PDF

If you want to remove all the fields from an existing PDF document, you can use MergeOptions class and set FormFields Boolean property to false. This will prevent the fields from getting imported
       
        Dim options As MergeOptions = MergeOptions.All
        options.FormFields = False

        Dim NewDoc As MergeDocument = New MergeDocument("input.pdf", options)
        NewDoc.Draw("output.pdf")

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 2:12 AM.