java - Print only one page of a multiple page pdf -


i have document has multiple pages. want print first pages , first page again.

is there attribute can set (printrequestattributeset) make sure prints first page? didn't find list of attributes can set printrequestattributeset.

you should use pageranges attribute print first page of document:

docprintjob printjob = printservice.createprintjob(); hashprintrequestattributeset attributes = new hashprintrequestattributeset(); attributes.add(new pageranges(1)); printjob.print(pdfdoc, attributes); 

full list of supported attributes can found @ documentation page of printrequestattribute.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -