iOS and PDF merge

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  iOS and PDF merge

DynamicPDF CoreSuite for .NET (v5) Forum

 May 11 2015 3:06 PM
It is not clearly stated anywhere - does Dynamic PDF work with iOS or not? On iOS 7 and 8, on iPhone and iPad, merged documents show up blank. DrawToWeb has both been used and not used, as have
 
document.Form.IsReadOnly = true;
document.Security = new HighSecurity();
document.Security.AllowEdit = false;

We've also included the ".pdf" file extension into the code to no avail.

Will anything produce a document with merged data that is visible in iOS or not? If not, that would at least take the frustration out of searching through the forums and we can move on to another product.
 May 12 2015 10:26 AM
Posted by a ceTe Software moderator
Hello,

Our product generates the PDF as per the PDF specification and they can be opened with any valid PDF viewer that adheres to the PDF specification. Try opening the same PDF in Adobe Reader on iOS and see if it displays correctly. If Adobe Reader renders the PDF correctly then the issue most likely lies within the other PDF viewer you are using on iOS. 

In any case please send the following information to support@cete.com so we can confirm where the issue lies.

1. Name and version of PDF viewer that is displaying the blank PDFs on iOS.
2. Exact version and build number of the DynamicPDF DLL file. You can get this information in DLL reference properties (Version and Description fields) in Visual Studio.
3. Input or source PDF used to generate the final output.
4. Code sample to recreate the behavior.
5. Output PDF.

Thanks,
ceTe Software Support Team.
 May 12 2015 1:31 PM
Thank you for your response. Here is the information:

1. Using both Adobe Reader v11.6.4 and Safari on iOS 7 & 8 to open pdf's.  The output is completely blank on Safari, completely blank in Adobe Reader with the exception of checkboxes.

2. DynamicPDF.35.dll / v5.0.2.35

3-5. Here is sample code used to generate the output. To send over the PDF document we use to merge our data would be a violation of our Partner agreements so can't send that over sorry. It's a PDF with textfields created in Acrobat X Pro from a Word document.


//Open connection to database, query database, get data, open datareader, read data into datareader

document = new MergeDocument();

document.Append(Server.MapPath(Request.ApplicationPath) + @"/applications/app1.pdf");

TextField LastName = (TextField)document.Form.Fields["LastName"];
 LastName.Value = (string) DataReader1.GetString(0).ToString();


MergeOptions options = new MergeOptions(true);
document.InitialPageZoom = PageZoom.FitWidth;

document.Form.IsReadOnly = true;
document.Security = new HighSecurity();
document.Security.AllowEdit = false;


document.Draw(@"" + (Server.MapPath(Request.ApplicationPath) + @"/complete/filename.pdf"));

 May 27 2015 2:39 PM
Posted by a ceTe Software moderator
We have looked into this issue further and the following code can be used to fix the issue where the field values are not displayed by iOS Preview. The code below replaces the form fields with a label containing the field values.

            PdfDocument pdfDocument = new PdfDocument("input.pdf");
            // Merged Document
            MergeDocument document = new MergeDocument();
            // Append the input document and return a Pages array
            Page[] pages = document.Append(pdfDocument, MergeOptions.None);
            // Retrieve the form fields
            PdfFormField ERName = pdfDocument.Form.Fields["ERName"];
            PdfFormField InsuredFirstName = pdfDocument.Form.Fields["InsuredFirstName"];
            PdfFormField InsuredLastName = pdfDocument.Form.Fields["InsuredLastName"];

            // Add the labels
            ERName.CreateLabel(pages[ERName.GetOriginalPageNumber() - 1], "ER Name", ceTe.DynamicPDF.Font.Helvetica, 12);
            InsuredFirstName.CreateLabel(pages[InsuredFirstName.GetOriginalPageNumber() - 1], "First Name", ceTe.DynamicPDF.Font.Helvetica, 12);
            InsuredLastName.CreateLabel(pages[InsuredLastName.GetOriginalPageNumber() - 1], "Last Name", ceTe.DynamicPDF.Font.Helvetica, 12);

            document.Security = new HighSecurity();
            document.Security.AllowEdit = false;
           
            document.Draw("output.pdf");

Thanks,
ceTe Software Support Team.
 May 27 2015 3:34 PM
This solution works perfectly! Thank you so much for your help -  DynamicPDF is a great product and the support you provide is incredible!

All times are US Eastern Standard time. The time now is 10:05 PM.