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.
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;
}