On Wed, 4 Feb 2026 08:26:01 GMT, GennadiyKrivoshein <[email protected]> wrote:
>> These changes fix https://bugs.openjdk.org/browse/JDK-8372952 "Printed >> content is cut off when width > height". >> >> There are three issues which cause this bug. >> #### The first issue >> Media printable area does not match the corresponding media size for the >> landscape-oriented medias. \ >> An example of the actual prints on a paper 80mmx40mm (Epson T-TA88V) >> [actual_cut_off.pdf](https://github.com/user-attachments/files/25064646/actual_cut_off.pdf) >> >> #### The second issue >> _MediaSize_ does not allow landscape-oriented medias (X dimension bigger >> than Y dimension of the media) so rotated size is used, but the media >> printable area stays the same - landscape-oriented. >> Current implementation does not allow to use landscape-oriented paper >> because _MediaSize_ >> constructor allows portrait paper only (width < height). >> >> I read comments about _MediaSize_ restrictions (width<height) in >> https://bugs.openjdk.org/browse/JDK-8041911, which states that this is "by >> design" and specification. But I did not find media size restrictions in the >> https://datatracker.ietf.org/doc/html/rfc2911. >> The RFC defines "orientation-requested" attribute, that was mentioned in the >> JDK-8041911 comments, but this attribute indicates the desired orientation >> for printed print-stream pages and is used for only a subset of the >> supported document formats ('text/plain' or 'text/html') to format the >> document. \ >> As described in the RFC >> https://datatracker.ietf.org/doc/html/rfc2911#section-15.3 >>> If the document data has been formatted, then go to step 2. Otherwise, the >>> document data MUST be formatted. The formatting detection algorithm is >>> implementation defined and is not specified by this document. The >>> formatting of the document data uses the "orientation-requested" attribute >>> to determine how the formatted print data should be placed on a >>> print-stream page >> >> Therefore, if a printer object uses a landscape-oriented paper, a document >> format is "text/plain" and an "orientation-requested" attribute contains >> "portrait" value then the printer object should rotate the document 90 >> degrees. \ >> If a printer uses a portrait-oriented paper, a document format is >> "text/plain," and an "orientation-requested" attribute contains value >> "portrait" then the printer object does no rotation. >> >> Also, https://datatracker.ietf.org/doc/html/rfc3382 defines a "media-size" >> IPP attribute which identifies the size of the media. The RFC contains an >> example of this attribute where the X-dimension (the ... > > GennadiyKrivoshein has updated the pull request incrementally with one > additional commit since the last revision: > > Reformat test I believe the same was fixed in [JDK-8295737](https://bugs.openjdk.org/browse/JDK-8295737)...That fix was also for macos. Did it regress? ------------- PR Comment: https://git.openjdk.org/jdk/pull/29560#issuecomment-3906505013
