We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDF filling issue

I developed a xamarin cross platorm app. I want to fill all field in the pdf file that i have created. In local debug everthing is working. I cant fill all i wanted field but in production only 4 or 5 fields are filling. Using "release" mode for creating production installation package. The pdf-file is added as an embedded resource in the PCL project. In my pcl project syncFusion.xamarin.pdf version is 14.4.0.20
here is my code for filling fields

publicstaticStreamCreateAndOpenPdfWithFormFieldValues(TypereferenceType,stringembeddedResourcePath,stringfilename,Dictionary<String,string> values =null,boolopenAfterCreate =false)

{

try

{

StreamdocStream = referenceType.GetTypeInfo().Assembly.GetManifestResourceStream(embeddedResourcePath);

vardocument =newPdfLoadedDocument(docStream);

PdfLoadedFormloadedForm = document.Form;

if(values !=null)

{

foreach(varfieldinloadedForm.Fields.OfType<PdfLoadedTextBoxField>())

{

if(!values.ContainsKey(field.Name))continue;

field.Text = values[field.Name] ??string.Empty;

}

}

MemoryStreamstream =newMemoryStream();

document.Save(stream);

document.Close(true);

if(openAfterCreate)

{

Xamarin.Forms.DependencyService.Get<ISaveFile>().Save(filename,"application/pdf", stream);

}

returnstream;

}

catch(Exceptionex)

{

}

}

publicstaticStreamMergePdfDocuments(IEnumerable<Stream> docStreams,stringfileName,boolopenAfterCreate =false)

{

PdfDocumentmergedDocument =newPdfDocument();

foreach(vardocStreamindocStreams)

{

vardocument =newPdfLoadedDocument(docStream);

PdfDocument.Merge(mergedDocument, document);

}

MemoryStreamstream =newMemoryStream();

mergedDocument.Save(stream);

mergedDocument.Close(true);

if(openAfterCreate)

{

Xamarin.Forms.DependencyService.Get<ISaveFile>().Save(fileName,"application/pdf", stream);

}

returnstream;

}


3 Replies

SL Sowmiya Loganathan Syncfusion Team September 27, 2017 02:12 PM UTC

Hi Yasin, 

We regret to let you know that we could not reproduce the issue with “PDF Form filling” .We have tried with sample in our side with the code snippet provided by you. We suspect this to be a document specific issue. Please share the input document we will analyze and update you with further information. 

Regards, 
Sowmiya L 



YA Yasin September 30, 2017 11:43 AM UTC

Thanks for reply Sowmiya. It was only displaying issue. I was viewing created pdf with Microsoft Edge. I installed Adobe PDF viewer. Now everytihng is perfect.



SK Surya Kumar Syncfusion Team October 2, 2017 07:00 AM UTC

Hi Yasin, 

Thanks for the update, please let us know if you need any further information. 

Regards, 
Surya Kumar

Loader.
Up arrow icon