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

Crop PDF page with SfPdfViewer

Hi everyone,


is there a way to crop a portion of a PDF page with the SfPdfViewer component?

Since we have to manage a situation where some people will load up a single page PDF and export only a portion of this, by looking at the documentation we didn't see any default editing option to crop a specific part of the page and, looking at other docs, we saw this option by doing it from code-behind.

Is there already an example, or maybe some guide lines, to follow for including a custom-made editing option to crop a page similar to what the SfImageEditor does to crop an image?


Thanks!


3 Replies

MA ManojKumar Arumugasamy Syncfusion Team October 21, 2022 05:03 AM UTC

Hi Danilo,
 

Greetings from Syncfusion support.

 

Presently, cropping PDF pages is not supported by pdfviewer.

 

Could you share more details on the following:

  1. Please let us know more details about why you need to crop a particular portion of the PDF.
  2. You need to select a specific portion from the UI or programmatically using APIs.
  3. After being cropped, do you need them as images or as PDFs?

 

Regards,
Manoj Kumar



DL DANILO LONGONI replied to ManojKumar Arumugasamy October 24, 2022 03:45 PM UTC

Hi,

here I'll share all the details required:

  1. Imagine a single pdf page with multiple floors of a single house, we've been asked to extract only a single floor instead of the whole page since they'll work on single remarks of a single floor
  2. Preferrably from the UI, since the end-user will select the portion to crop
  3. If possible both options, since PdfViewer already has this option. If not, at least as image



Thanks for your support



MA ManojKumar Arumugasamy Syncfusion Team October 26, 2022 02:44 PM UTC

Hi Danilo,

SfPdfViewer does not support cropping of a Pdf page from the UI. Although you can crop the pdf page with the help of our pdf library programmatically, please do follow the link for more details: How to crop PDF in Xamarin Forms | Syncfusion KB. The cropped page can only be converted to pdf and not to image format.

Regards,

Manoj


Loader.
Live Chat Icon For mobile
Up arrow icon