Details
Description
Note from customer:
Changes in the print dialog don't have an effect on the currently printed document but only on next the following documents.
The org.icepdf.ri.common.PrintHelper.java class holds two member member attribute sets that are not functional independent.
private HashDocAttributeSet docAttributeSet;
private HashPrintRequestAttributeSet printRequestAttributeSet;
both are initialized in the
PrintHelper(DocumentViewController,
PageTree
MediaSizeName
PrintQuality)
constructor.
Into both of these attribute sets arte initialized to hold a MediaSize and a MediaPrintableArea Attribute.
Both initial values are set to NA_LETTER if no persisted properties are found or to whatever is defined in the properties file.
Before printing is started a printing dialog is opened.
But if the media size is changed in this dialog, the result is not transferred into the docAttributeSet so these attribute sets are no longer consistent. For rendering the PDF in PrintHelper.print() a PageFormat is given which is taken from the docAttributeSet and the media change in the print dialog is ignored.
It is either necessary to synchronize the Media and MediaPrintableAreaSize attributes in the docAttributeSet and the printRequestAttributeSet after the printDialog returns or not to define these attributes in the docAttributeSet in the first place. So the user has the possibility to change the media size in the print dialog.
Changes in the print dialog don't have an effect on the currently printed document but only on next the following documents.
The org.icepdf.ri.common.PrintHelper.java class holds two member member attribute sets that are not functional independent.
private HashDocAttributeSet docAttributeSet;
private HashPrintRequestAttributeSet printRequestAttributeSet;
both are initialized in the
PrintHelper(DocumentViewController,
PageTree
MediaSizeName
PrintQuality)
constructor.
Into both of these attribute sets arte initialized to hold a MediaSize and a MediaPrintableArea Attribute.
Both initial values are set to NA_LETTER if no persisted properties are found or to whatever is defined in the properties file.
Before printing is started a printing dialog is opened.
But if the media size is changed in this dialog, the result is not transferred into the docAttributeSet so these attribute sets are no longer consistent. For rendering the PDF in PrintHelper.print() a PageFormat is given which is taken from the docAttributeSet and the media change in the print dialog is ignored.
It is either necessary to synchronize the Media and MediaPrintableAreaSize attributes in the docAttributeSet and the printRequestAttributeSet after the printDialog returns or not to define these attributes in the docAttributeSet in the first place. So the user has the possibility to change the media size in the print dialog.
Customer has asked if we can also review adding the properties defined in the document.