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.
Unfortunately, activation email could not send to your email. Please try again.

PDF filling issue

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 10:12 AM

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 07:43 AM

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 03:00 AM

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.

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.

;