Rectangles need to be normalized for use:

   Rectangles are used to describe locations on a page and bounding
   boxes for a variety of objects, such as fonts. A rectangle is
   written as an array of four numbers giving the coordinates of a pair
   of diagonally opposite corners. Typically, the array takes the form

   [ llx lly urx ury ]

   specifying the lower-left x, lower-left y, upper-right x, and
   upper-right ycoordinates of the rectangle, in that order. The other
   two corners of the rectangle are then assumed to have coordinates
   (llx, ury) and (urx, lly).

   /Note: Although rectangles are conventionally specified by their
   lower-left and upper-right corners, it is acceptable to specify any
   two diagonally opposite corners. Applications that process PDF
   should be prepared to normalize such rectangles in situations where
   specific corners are required./

So the MediaBox should be (rewritten internally) as  (0, -6600, 5100, 0)

I've seen this fairly often in a previous life.

Marc

On 8/4/2025 8:56 PM, Tilman Hausherr wrote:
Hi,

I'm not yet sure if this is a bug or expected behavior, but I noticed this:


The mediabox (and the cropbox) have a negative Y bound, this is weird. It could be that the software sets the overlay at (0,0) so it will be invisible.

Tilman

Am 05.08.2025 um 00:04 schrieb Brent:
I have a sample pdf and overlay attached.  When I run the command:

 java.exe  -jar pdfbox-app-3.0.5.jar overlay -i originalPDF.pdf -default overlay.pdf -position FOREGROUND -o output.pdf

The resulting PDF does not have an overlay.  The document size increases, so I believe the overlay operation is performed, but it does not render.  Note, the same result occurs when running the API.

I have used overlay successfully on other documents, but I have a document set that it does not work on and this is a sample of the scenario.

Is this something that should be reported as a bug?

Thank you,
Brent

---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail:users-h...@pdfbox.apache.org

Reply via email to