Custom PDF Page Size |
The converter can produce PDF documents with pages of any size. The page size is set with the PdfPageSize property, of type PdfPageSize: a standard size like A4 (the default), A3 or Letter, or Custom. With Custom, the page size is given by the CustomPdfPageSize property.
The code below sets the converter to produce pages 200 points wide and 300 points high. A point is 1/72 inch.
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.Custom; pdfConverter.PdfDocumentOptions.CustomPdfPageSize = new SizeF(200, 300);
The custom size is 595 x 842 points by default, the size of an A4 portrait page. PdfPageOrientation set to Landscape turns the page so that its longer side is horizontal. The margins are set with the LeftMargin, RightMargin, TopMargin and BottomMargin properties of the same object, in points.
SizeF is in the ExpertPdf.Anywhere.Drawing namespace.