Zoom PDF File using C#

This article explains how to zoom PDF file using C#. It has the IDE settings, a list of steps, and a sample code to set PDF zoom size using C#. You will learn to select the page, starting position, and zoom factor by default when you open the processed PDF file in viewer software.

Steps to Zoom PDF using C#

  1. Set the IDE to use Aspose.PDF for .NET to zoom the PDF file
  2. Load the source PDF file into the Document object for zooming in when opened
  3. Create the GoToAction object
  4. Create the explicit destination by setting the desired parameters
  5. Set this action as the open action for the PDF
  6. Save the PDF with custom open action

The above steps summarize how to apply the feature of PDF zoom out using C#. You can apply this feature by opening the source PDF file and creating the GoToAction with the target destination page, position, and zoom level. Finally, set this action as the OpenAction of the PDF file, which will be activated when you open the PDF file in a reader such as Adobe Acrobat Reader.

Code to Zoom Out PDF using C#

This sample code demonstrates how to implement PDF zoom in using C#. You need to set the page number starting from index 0, the top-left position to set the initial viewing position, and the zoom factor, considering the existing zoom level as 1. For example, setting the zoom factor to 0.5 will zoom out the PDF file to view double the content. You may use GoToRemoteAction to jump to another PDF file and LaunchAction to launch an application, open an application, or print the document.

This article has taught us how to set the PDF open action to zoom the PDF to the desired level. If you want to split a PDF file by pages, refer to the article on how to split PDF file by pages in C#.

 English