We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF form filling with Key Value

Hi Team ,

We are trying to fill the pdf form with the below code .

foreach (var field in request.KeyValueCollection)
{

                    pdfForm.FillField(field.Key, field.Value.ToString());
                }

When the pdf has more than 200 keys , it takes around 9 mins to fill the form.

We would like to know if there is any optimized way to fill the form using Aspose,pdf

Thanks,
Sowmya

@sowmyagirish

Thanks for contacting support.

Would you please share a sample input PDF document along with complete Collection of key-value pairs. We will test the scenario in our environment and address it accordingly.

Attaching the sample pdf .

Below are the keys in this format {[key,value]} . CurrentlyTest.pdf (2.1 MB)
all the values are null.
{[SRSLLicenseeName, ]}
{[SRSLLicenseeNumber, ]}
{[RegulatorySLNamedInsured, ]}
{[RegulatorySLPolicyNumber, ]}
{[DescriptionOfBusiness, ]}
{[MassachusettsAddress, ]}
{[PolicyLOBCode, ]}
{[CoverageLimit, ]}
{[RegulatorySLEffectiveDate, ]}
{[SLCarrierName, ]}
{[NAICAA, ]}
{[TaxStateGrid1, ]}
{[TaxStateGrid2, ]}
{[TaxStateGrid3, ]}
{[TaxStateGrid4, ]}
{[TaxStateGrid5, ]}
{[TaxStateGrid6, ]}
{[TaxStateGrid7, ]}
{[TaxablePremiumGrid1, ]}
{[Return Premium1, ]}
{[NetPremium1, 0]}
{[TaxStateGrid8, ]}
{[TaxStateGrid9, ]}
{[TaxStateGrid10, ]}
{[TaxStateGrid11, ]}
{[TaxStateGrid12, ]}
{[TaxStateGrid13, ]}
{[TaxStateGrid14, ]}
{[TaxStateGrid15, ]}
{[TaxablePremiumGrid2, ]}
{[TaxablePremiumGrid3, ]}
{[TaxablePremiumGrid4, ]}
{[TaxablePremiumGrid5, ]}
{[TaxablePremiumGrid6, ]}
{[TaxablePremiumGrid7, ]}
{[TaxablePremiumGrid8, ]}
{[TaxablePremiumGrid9, ]}
{[TaxablePremiumGrid10, ]}
{[TaxablePremiumGrid11, ]}
{[TaxablePremiumGrid12, ]}
{[TaxablePremiumGrid13, ]}
{[TaxablePremiumGrid14, ]}
{[TaxablePremiumGrid15, ]}
{[Return Premium2, ]}
{[Return Premium3, ]}
{[Return Premium4, ]}
{[Return Premium5, ]}
{[Return Premium6, ]}
{[Return Premium7, ]}
{[Return Premium8, ]}
{[Return Premium9, ]}
{[Return Premium10, ]}
{[Return Premium11, ]}
{[Return Premium12, ]}
{[Return Premium13, ]}
{[Return Premium14, ]}
{[Return Premium15, ]}
{[NetPremium2, 0]}
{[NetPremium3, 0]}
{[NetPremium4, 0]}
{[NetPremium5, 0]}
{[NetPremium6, 0]}
{[NetPremium7, 0]}
{[NetPremium8, 0]}
{[NetPremium9, 0]}
{[NetPremium10, 0]}
{[NetPremium11, 0]}
{[NetPremium12, 0]}
{[NetPremium13, 0]}
{[NetPremium14, 0]}
{[NetPremium15, 0]}
{[InvoiceAmountGrid1, ]}
{[InvoiceAmountGrid2, ]}
{[InvoiceAmountGrid3, ]}
{[SLTaxGrid1, 1]}
{[TaxFeeTotal1, 1]}
{[InvoiceAmountGrid4, ]}
{[InvoiceAmountGrid5, ]}
{[InvoiceAmountGrid6, ]}
{[InvoiceAmountGrid7, ]}
{[InvoiceAmountGrid8, ]}
{[InvoiceAmountGrid9, ]}
{[InvoiceAmountGrid10, ]}
{[InvoiceAmountGrid11, ]}
{[InvoiceAmountGrid12, ]}
{[InvoiceAmountGrid13, ]}
{[InvoiceAmountGrid14, ]}
{[InvoiceAmountGrid15, ]}
{[SLTaxGrid2, ]}
{[SLTaxGrid3, ]}
{[SLTaxGrid4, ]}
{[SLTaxGrid5, ]}
{[SLTaxGrid6, ]}
{[SLTaxGrid7, ]}
{[SLTaxGrid8, ]}
{[SLTaxGrid9, ]}
{[SLTaxGrid10, ]}
{[SLTaxGrid11, ]}
{[SLTaxGrid12, ]}
{[SLTaxGrid13, ]}
{[SLTaxGrid14, ]}
{[SLTaxGrid15, ]}
{[TaxFeeTotal2, 0]}
{[TaxFeeTotal3, 0]}
{[TaxFeeTotal4, 0]}
{[TaxFeeTotal5, 0]}
{[TaxFeeTotal6, 0]}
{[TaxFeeTotal7, 0]}
{[TaxFeeTotal8, 0]}
{[TaxFeeTotal9, 0]}
{[TaxFeeTotal10, 0]}
{[TaxFeeTotal11, 0]}
{[TaxFeeTotal12, 0]}
{[TaxFeeTotal13, 0]}
{[TaxFeeTotal14, 0]}
{[TaxFeeTotal15, 0]}
{[TaxStateGrid16, ]}
{[TaxablePremiumGrid16, ]}
{[TaxStateGrid17, ]}
{[TaxablePremiumGrid17, ]}
{[InvoiceAmountGrid17, ]}
{[TaxStateGrid18, ]}
{[TaxablePremiumGrid18, ]}
{[TaxStateGrid19, ]}
{[TaxablePremiumGrid19, ]}
{[Return Premium19, ]}
{[TaxStateGrid20, ]}
{[TaxablePremiumGrid20, ]}
{[TaxStateGrid21, ]}
{[TaxablePremiumGrid21, ]}
{[TaxStateGrid22, ]}
{[TaxablePremiumGrid22, ]}
{[NetPremium22, 0]}
{[InvoiceAmountGrid22, ]}
{[TaxStateGrid23, ]}
{[TaxablePremiumGrid23, ]}
{[NetPremium23, 0]}
{[InvoiceAmountGrid23, ]}
{[TaxStateGrid24, ]}
{[TaxablePremiumGrid24, ]}
{[NetPremium24, 0]}
{[InvoiceAmountGrid24, ]}
{[TaxFeeTotal24, 0]}
{[TaxStateGrid25, ]}
{[TaxablePremiumGrid25, ]}
{[NetPremium25, 0]}
{[InvoiceAmountGrid25, ]}
{[TaxFeeTotal25, 0]}
{[TaxStateGrid26, ]}
{[TaxablePremiumGrid26, ]}
{[NetPremium26, 0]}
{[InvoiceAmountGrid26, ]}
{[TaxFeeTotal26, 0]}
{[TaxStateGrid27, ]}
{[TaxablePremiumGrid27, ]}
{[NetPremium27, 0]}
{[InvoiceAmountGrid27, ]}
{[TaxFeeTotal27, 0]}
{[TaxStateGrid28, ]}
{[TaxablePremiumGrid28, ]}
{[NetPremium28, 0]}
{[InvoiceAmountGrid28, ]}
{[TaxFeeTotal28, 0]}
{[TaxStateGrid29, ]}
{[TaxablePremiumGrid29, ]}
{[NetPremium29, 0]}
{[InvoiceAmountGrid29, ]}
{[TaxFeeTotal29, 0]}
{[TaxStateGrid30, ]}
{[TaxablePremiumGrid30, ]}
{[NetPremium30, 0]}
{[InvoiceAmountGrid30, ]}
{[TaxFeeTotal30, 0]}
{[TaxStateGrid31, ]}
{[TaxablePremiumGrid31, ]}
{[NetPremium31, 0]}
{[InvoiceAmountGrid31, ]}
{[TaxFeeTotal31, 0]}
{[TaxStateGrid32, ]}
{[TaxablePremiumGrid32, ]}
{[NetPremium32, 0]}
{[NetPremium34, 0]}
{[InvoiceAmountGrid32, ]}
{[TaxFeeTotal32, 0]}
{[TaxStateGrid33, ]}
{[TaxablePremiumGrid33, ]}
{[NetPremium33, 0]}
{[InvoiceAmountGrid33, ]}
{[TaxFeeTotal33, 0]}
{[TaxStateGrid34, ]}
{[TaxablePremiumGrid34, ]}
{[InvoiceAmountGrid34, ]}
{[TaxFeeTotal34, 0]}
{[TaxStateGrid35, ]}
{[TaxablePremiumGrid35, ]}
{[TaxStateGrid36, ]}
{[TaxStateGrid37, ]}
{[NetPremium37, 0]}
{[TaxStateGrid38, ]}
{[TaxStateGrid39, ]}
{[TaxStateGrid40, ]}
{[TaxStateGrid41, ]}
{[TaxStateGrid42, ]}
{[TaxStateGrid43, ]}
{[TaxStateGrid44, ]}
{[TaxStateGrid45, ]}
{[TaxStateGrid46, ]}
{[TaxStateGrid47, ]}
{[TaxStateGrid48, ]}
{[TaxStateGrid49, ]}
{[TaxStateGrid50, ]}
{[TaxablePremiumGrid36, ]}
{[TaxablePremiumGrid38, ]}
{[TaxablePremiumGrid39, ]}
{[TaxablePremiumGrid40, ]}
{[TaxablePremiumGrid41, ]}
{[TaxablePremiumGrid42, ]}
{[TaxablePremiumGrid45, ]}
{[TaxablePremiumGrid46, ]}
{[TaxablePremiumGrid47, ]}
{[TaxablePremiumGrid48, ]}
{[TaxablePremiumGrid49, ]}
{[TaxablePremiumGrid51, ]}
{[Return Premium16, ]}
{[Return Premium17, ]}
{[Return Premium18, ]}
{[Return Premium20, ]}
{[Return Premium21, ]}
{[Return Premium22, ]}
{[Return Premium23, ]}
{[Return Premium24, ]}
{[Return Premium25, ]}
{[Return Premium26, ]}
{[Return Premium27, ]}
{[Return Premium28, ]}
{[Return Premium29, ]}
{[Return Premium30, ]}
{[Return Premium31, ]}
{[Return Premium32, ]}
{[Return Premium33, ]}
{[Return Premium34, ]}
{[Return Premium35, ]}
{[InvoiceAmountGrid35, ]}
{[TaxFeeTotal35, 0]}
{[InvoiceAmountGrid36, ]}
{[TaxFeeTotal36, 0]}
{[TaxFeeTotal37, 0]}
{[InvoiceAmountGrid37, ]}
{[NetPremium35, 0]}
{[Return Premium36, ]}
{[NetPremium36, 0]}
{[Return Premium37, ]}
{[Return Premium38, ]}
{[NetPremium38, 0]}
{[InvoiceAmountGrid38, ]}
{[TaxFeeTotal38, 0]}
{[Return Premium39, ]}
{[InvoiceAmountGrid39, ]}
{[TaxFeeTotal39, 0]}
{[Return Premium40, ]}
{[Return Premium41, ]}
{[Return Premium42, ]}
{[Return Premium45, ]}
{[Return Premium46, ]}
{[Return Premium47, ]}
{[Return Premium48, ]}
{[Return Premium49, ]}
{[Return Premium50, ]}
{[Return Premium51, ]}
{[NetPremium16, 0]}
{[NetPremium17, 0]}
{[NetPremium18, 0]}
{[NetPremium19, 0]}
{[NetPremium20, 0]}
{[NetPremium21, 0]}
{[NetPremium39, 0]}
{[NetPremium40, 0]}
{[NetPremium41, 0]}
{[NetPremium42, 0]}
{[NetPremium44, 0]}
{[NetPremium45, 0]}
{[NetPremium46, 0]}
{[NetPremium49, 0]}
{[NetPremium50, 0]}
{[NetPremium51, 0]}
{[InvoiceAmountGrid16, ]}
{[InvoiceAmountGrid18, ]}
{[InvoiceAmountGrid19, ]}
{[InvoiceAmountGrid20, ]}
{[InvoiceAmountGrid21, ]}
{[InvoiceAmountGrid40, ]}
{[InvoiceAmountGrid41, ]}
{[InvoiceAmountGrid42, ]}
{[InvoiceAmountGrid43, ]}
{[InvoiceAmountGrid44, ]}
{[InvoiceAmountGrid46, ]}
{[InvoiceAmountGrid47, ]}
{[InvoiceAmountGrid48, ]}
{[InvoiceAmountGrid49, ]}
{[InvoiceAmountGrid50, ]}
{[InvoiceAmountGrid51, ]}
{[SLTaxGrid16, ]}
{[SLTaxGrid17, ]}
{[SLTaxGrid18, ]}
{[SLTaxGrid19, ]}
{[SLTaxGrid20, ]}
{[SLTaxGrid21, ]}
{[SLTaxGrid22, ]}
{[SLTaxGrid23, ]}
{[SLTaxGrid24, ]}
{[SLTaxGrid25, ]}
{[SLTaxGrid26, ]}
{[SLTaxGrid27, ]}
{[SLTaxGrid28, ]}
{[SLTaxGrid29, ]}
{[SLTaxGrid30, ]}
{[SLTaxGrid31, ]}
{[SLTaxGrid32, ]}
{[SLTaxGrid33, ]}
{[SLTaxGrid34, ]}
{[SLTaxGrid35, ]}
{[SLTaxGrid36, ]}
{[SLTaxGrid37, ]}
{[SLTaxGrid38, ]}
{[SLTaxGrid39, ]}
{[SLTaxGrid40, ]}
{[SLTaxGrid41, ]}
{[SLTaxGrid42, ]}
{[SLTaxGrid43, ]}
{[SLTaxGrid44, ]}
{[SLTaxGrid45, ]}
{[SLTaxGrid46, ]}
{[SLTaxGrid48, ]}
{[SLTaxGrid49, ]}
{[SLTaxGrid50, ]}
{[SLTaxGrid51, ]}
{[TaxFeeTotal40, 0]}
{[TaxablePremiumGrid43, ]}
{[Return Premium43, ]}
{[NetPremium43, 0]}
{[TaxablePremiumGrid44, ]}
{[Return Premium44, ]}
{[TaxFeeTotal16, 0]}
{[TaxFeeTotal17, 0]}
{[TaxFeeTotal18, 0]}
{[TaxFeeTotal19, 0]}
{[TaxFeeTotal20, 0]}
{[TaxFeeTotal21, 0]}
{[TaxFeeTotal22, 0]}
{[TaxFeeTotal23, 0]}
{[TaxablePremiumGrid37, ]}
{[TaxFeeTotal41, 0]}
{[TaxFeeTotal42, 0]}
{[TaxFeeTotal43, 0]}
{[TaxFeeTotal44, 0]}
{[InvoiceAmountGrid45, ]}
{[TaxFeeTotal45, 0]}
{[TaxFeeTotal46, 0]}
{[NetPremium47, 0]}
{[SLTaxGrid47, ]}
{[TaxFeeTotal47, 0]}
{[NetPremium48, 0]}
{[TaxFeeTotal48, 0]}
{[TaxFeeTotal49, 0]}
{[TaxablePremiumGrid50, ]}
{[TaxFeeTotal50, 0]}
{[TaxStateGrid51, ]}
{[TaxFeeTotal51, 0]}
{[ReturnPremiumTotal, 0]}
{[NetPremiumTotal, 0]}
{[SLTaxGridTotal, 1]}
{[TaxFeeTotalSum, 1]}
{[GrossPremiumTotal, 0]}
{[GrossPolicyPremiumTotal, 0]}
{[TotalReturnPremium, 0]}
{[TotalNetPremium, 0]}

Let me know if more details are needed.

Thanks.

@sowmyagirish

Thanks for sharing required information.

We were able to replicate the issue in our environment and noticed the delay in processing form filling. We have logged an issue as PDFNET-45575 in our issue tracking system to further investigate performance of the API for your PDF document. We will surely keep you posted with the status of investigation progress within this forum thread. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-45575) have been fixed in Aspose.PDF for .NET 20.1.