Form.FlattenField throws an exception

Will it ever be done?

Thanks.

@dpreznik

Thank you for getting back to us.

Please note that the priority has been raised already and we understand importance of this issue so we will be scheduling it at our earliest. Please spare us little more time and we will update you as soon as any progress is made in this regard.

@dpreznik

Thank you for being patient.

We would like to inform you that we have figured out that source PDF document does not contain the field CUSTOMER_PRICEHEADING2.

We have filtered fields which contain “PRICE” and below is the list for your kind reference:

9257 - 0005 - 2_PRICE2
9257 - 0401 - 2_PRICE2
    CUSTOMER_PRICEHEADING
S - 09235 - NF - 19_PRICE
S - 09235 - NF - 19_PRICE2
0024 - 0001 - 2_PRICE2
0024 - 0001 - 2_PRICE
9354 - 0050 - 21_PRICE
9354 - 0050 - 21_PRICE2
9369 - 0030 - 22_PRICE
9369 - 0030 - 22_PRICE2
0261 - 0040 - 21_PRICE
0261 - 0040 - 21_PRICE2
9359 - 0050 - 21_PRICE
9359 - 0050 - 21_PRICE2
9329 - 0060 - 21_PRICE
9329 - 0060 - 21_PRICE2
S - 310AB - NC - 08_PRICE
S - 310AB - NC - 08_PRICE2
S - 310AB - NC - 08 - 1_PRICE
S - 310AB - NC - 08 - 1_PRICE2
S - 310AB - NC - 10_PRICE
S - 310AB - NC - 10_PRICE2
S - 310AB - NC - 10 - 1_PRICE
S - 310AB - NC - 10 - 1_PRICE2
S - 310AB - CC - 10_PRICE
S - 310AB - CC - 10_PRICE2
S - 310AB - CC - 10 - 1_PRICE
S - 310AB - CC - 10 - 1_PRICE2
        RT8480310_PRICE
RT8480310_PRICE2
RT8480500_PRICE
RT8480500_PRICE2
2844 - 0025 - 2_PRICE
2844 - 0025 - 2_PRICE2
0444 - 0050 - 2_PRICE
0444 - 0050 - 2_PRICE2
S - 228P4 - NS - 03_PRICE
S - 228P4 - NS - 03_PRICE2
1344 - 0409 - 2_PRICE
1344 - 0409 - 2_PRICE2
6244 - 0120 - 2_PRICE
6244 - 0120 - 2_PRICE2
9118 - 0601 - 2_PRICE
9118 - 0601 - 2_PRICE2

Thus, only CUSTOMER_PRICEHEADING exists so the exception is thrown. We hope this will be helpful. Please feel free to contact us if you need any further assistance.

I am sorry, but this is not the cause. I don’t have the pdf that I initially provided you with, but the field does exist in our pdf files. Moreover, you admit that CUSTOMER_PRICEHEADING exists in the file, and yet I keep receiving the same error on this field, too. Please help.

@dpreznik

We have used below code with your file using Aspose.PDF for .NET 19.2 but we can not notice any problem. Generated PDF document has also been attached for your kind reference. AsposeResult.pdf

Dim inForm As Form
Dim fieldName As String = "CUSTOMER_PRICEHEADING"
Dim destFilePath As String = dataDir + "AsposeResult.pdf"
inForm = New Form(dataDir + "DS-692.0-1217_2018 Domestic Pricebook-504k34kqa22ipwld0ujsjlpe.pdf")
inForm.FillField(fieldName, "Dummy Data")

' Make this field un-editable
inForm.FlattenField(fieldName)
inForm.Save(destFilePath)

If the issue persists, then please share a sample application so that we may investigate in in our environment.

It is resolved! Thank you for your help.