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

How to render listview into pdf file

Thread ID:





143755 Apr 4,2019 12:40 AM UTC Apr 11,2019 12:08 PM UTC UWP 3
Tags: Pdf
Asked On April 4, 2019 12:40 AM UTC

I have a large items ListView on my xaml page, I want to save it as a pdf file.

I used the attached code sample to save listview in pdf, but it did not render the whole listview in pdf file. How to solve this issue.


Attachment: XAMLtoPDF_Sample_88452c8c.zip

Abirami Varadharajan [Syncfusion]
Replied On April 9, 2019 10:15 AM UTC

Hi Xavier,  

While converting UI XAML  element to PDF in UWP we depend on the RenderTargetBitmap class to convert the current view in app window to image and insert the image in PDF. So the XAML to image conversion is dependent on UWP control.  
We have modified the sample to create page in the size of image and the orientation based on the width and height of image. You may alter the XAML to Image conversion based on your requirement . 

You may refer the below mentioned UG documentation link to know about drawing images in PDF document: 


Replied On April 10, 2019 07:17 AM UTC

It still cannot capture the whole ListView's items into pdf file.

Abirami Varadharajan [Syncfusion]
Replied On April 11, 2019 12:08 PM UTC

Hi Xavier, 

As mentioned in our previous update the XAML to image conversion is performed using  RenderTargetBitmap class and this create bitmap image for only visible layout window in UWP platform. We used the same image which we get from this conversion and insert in  PDF . 

Since the XAML to image conversion using RenderTargetBitmap  in UWP does not capture the whole window as bitmap image. We cannot proceed further on fixing this from our side. 



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon