Page/sheet size setting in PDF-XChange Drivers API version 8
Posted: Tue Aug 06, 2019 9:21 am
I have been using PDF-XChange Drivers API SDK version 5 in the past. For version 5 I set page size using the "Dev.<propertyName>" properties, which seem not to be supported with version 8 anymore - at least my code runs into an exception.
Evaluating version 8 for an update revealed an issue setting the required page/sheet size. I am developing in C#.
I checked the API documentation, the examples and developer forums but could not find any hint.
Here is an excerpt of my code:
<width> and <height> are integer values. Regardless of whatever values I specify for "Paper.SheetWidth" and "Paper.SheetHeight" the PDF is generated using ISO A4.
What am I doing wrong?
Evaluating version 8 for an update revealed an issue setting the required page/sheet size. I am developing in C#.
I checked the API documentation, the examples and developer forums but could not find any hint.
Here is an excerpt of my code:
Code: Select all
printer.set_Option("Paper.LayoutType", "Normal");
printer.set_Option("Paper.SheetSizeIndex", -2);
logger.Debug(String.Format("Page [layout: {0}, width: {1}, height: {2}]", pageLayout, width, height));
printer.set_Option("Paper.SheetWidth", width);
printer.set_Option("Paper.SheetHeight", height);
printer.ApplyOptions(0);
What am I doing wrong?