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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

130391 May 10,2017 01:57 PM May 11,2017 08:37 AM Xamarin.Forms 1
loading
Tags: PDF
Dachi Gogotchuri
Asked On May 10, 2017 01:57 PM

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!

Chinnu Muniyappan [Syncfusion]
Replied On May 11, 2017 08:37 AM

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 
 


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.

;