Latest build of Aspose.PDF will not populate fields correctly if the names are duplicated.
Hi,
Can you please share the code snippet which you are using and resultant PDF document generated at your end, so that we can test the scenario in our environment. We are sorry for this inconvenience.
We rolled back the update, and did not save a copy of the printed PDFs which were in error.
So sending a pdf result is not possible.
However, for the code:
We a class we use, here is a snippet of code from it:
public class Form: BaseDocument
{
private PDF.Form _form;
public bool FillField( string fieldName,
string fieldValue )
{
try
{
if( !HasField( fieldName ) )
return false;
_form.FillField( fieldName, fieldValue );
return true;
}
catch( Exception )
{
return false;
}
}
public bool FillForm( IDictionary values )
{
try
{
foreach( KeyValuePair keyValuePair in values )
_form.FillField( keyValuePair.Key, keyValuePair.Value );
_form.FlattenAllFields();
_form.Save( DestinationFileName );
return true;
}
catch( Exception )
{
return false;
}
}
public bool HasField( string fieldName )
{
try
{
return _form != null && _form.FieldNames.Contains( fieldName );
}
catch( Exception )
{
return false;
}
}
}
Hi,
Thanks for sharing the code snippet.
I am working on replicating the issue using this newly shared code but it appears that you have lots of custom defined variables and methods, so the testing is taking a bit longer. Can you please share some sample project, so that we can again try replicating it our environment. We are sorry for this delay and inconvenience.