Get page width for a specific page index.
double getPageWidth(int index) { if (index >= 0 && index < pageCount) { return document.pages[index].width; } return 612; // default US Letter width }