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

How to render listview into pdf file

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

3 Replies

AV Abirami Varadharajan Syncfusion Team 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: 


TI Timo April 10, 2019 07:17 AM UTC

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

AV Abirami Varadharajan Syncfusion Team 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. 


Live Chat Icon For mobile
Up arrow icon