Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upResizePage
Table of Contents |
Overview
Performs a page resize on all pages in a template.
Parameters
Width (multiple) The Measurement Unit defining the new page width.
Height (multiple) The Measurement Unit defining the new page height.
ErrorMessage (multiple | optional) The error message to return when any error occurs.
Synopsis
This method physically changes the template page size for all pages in the rendered output. The supplied value must be a valid Measurement Unit. For example, you can define a page size with the following values: Width = 5in, Height = 3in. Objects on the page do not resize.
Special Note
Resizing the page does not resize the elements on the page. There is a risk that the elements will render outside the printable area.
Source Code
public static void ResizePage(string Width, string Height, object ErrorMessage)
{
Break();
try
{
Document doc = Application.CurrentDocument;
doc.PageHeight = Height;
doc.PageWidth = Width;
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}