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

Generating custom pdf on a XF or X.iOS/X.Android app.

I'm comming from this thread:

Now it's time to evaluate the possibility make the same library for Xamarin Forms or Xamarin Classic.

I see that in UWP, there is the possibility to
  • Encrypt/decrypt PDF using 128-bit and 256-bit AES algorithm.
  • Embed PNG images.
  • XFA Forms (Create and modify forms)
  • Use custom fonts and styles
And here contrasted that this functionality is not supported on Xamarin.

I wanted to confirm and ask if this functionality will come soon on Xamarin because they are fundamental for what we want to do.

Thank's!

1 Reply

CM Chinnu Muniyappan Syncfusion Team May 11, 2017 12:37 PM UTC

Hi Dachi, 
 
Thank you for contacting Syncfusion support. 
 
  • Encrypt/decrypt PDF using 128-bit and 256-bit AES algorithm.
  • Embed PNG images.
  • XFA Forms (Create and modify forms)
At present, we do not have support for  
 
1. Need add support PDF encryption and decryption in Xamarin.Forms platform 
 
2. Need to add support for PNG image drawing in Xamarin PDF 
 
3.Need to add XFA form fields support in Xamarin platform 
 
So, we have logged a feature request regarding this. We do not have any immediate plan to implement this feature, We will implement this features in any of our upcoming releases. We usually have an interval of at least three months between releases. The features implementation would also greatly depend on the factors such as product design, code compatibility and complexity. Please log on to our support website to check for further updates:  
  
 
 
 
Use custom fonts and styles 
Essential PDF provides custom font support in Xamarin platform by using PdfTrueTypeFont object with embedded font stream. Please refer the below sample for more details. details. 
 
Refer the blow documentation link for more details. 
 
we can also set the text rendering styles in PDF document by using PdfStringFormat instance. Please refer the below code snippet for more details. 
               //Create a new PDF document 
               PdfDocument document = new PdfDocument();                 
 
                //Add page to the PDF document. 
                PdfPage page = document.Pages.Add();                          
 
                //Create graphics instance. 
                PdfGraphics g = page.Graphics; 
 
                //Read the embedded font file 
                Stream fontStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("FontEmbedding.Assets.arial.ttf"); 
 
                //Create a new true type font by using the embedded font              
                PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream,13,PdfFontStyle.Regular); 
 
                //Create a new PDF Brush 
                PdfBrush brush = PdfBrushes.Black; 
 
                //Create a new PDF string format 
                PdfStringFormat textFormat = new PdfStringFormat(); 
 
                //Align the text horizontally  
                textFormat.Alignment = PdfTextAlignment.Center; 
 
                //Set the vertical alignment  
                textFormat.LineAlignment = PdfVerticalAlignment.Middle; 
 
                //Draw the text  
                g.DrawString("Syncfusion", font, brush, new RectangleF(0, 0, 200, 100), textFormat); 
 
                MemoryStream stream = new MemoryStream(); 
 
                                  //Save the PDF document 
                document.Save(stream); 
 
 
 
 
 
 
Please let us know if you need further assistance. 
Regards, 
Chinnu 
 


Loader.
Live Chat Icon For mobile
Up arrow icon