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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF filling issue

Thread ID:

Created:

Updated:

Platform:

Replies:

132869 Sep 26,2017 11:01 AM UTC Oct 2,2017 07:00 AM UTC Xamarin.Forms 3
loading
Tags: PDF
Yasin
Asked On September 26, 2017 11:09 AM UTC

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;

}


Sowmiya Loganathan [Syncfusion]
Replied On 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 


Yasin
Replied On 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.


Surya Kumar [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;