Print different sizes pages in Java with Java Print Services
I am trying to print different sized pages in JPS using a Book object. I create a custom PageFormat and I have a custom print() method in the SwingComponent. I can see that the PageFormat is correct, but the actu开发者_Go百科al printed page always takes the size of the first page, not the page size for each PageFormat.
Any suggestions on how I can fix this?
you can give the PrinterJob a
HashPrintRequestAttributeSet
where you can set the Preferences (for PrintDialog), but i see no sense to use it for every page, try to adjust in the print() method, for every page, the mentioned Set.
精彩评论