You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Michael Horne <mi...@thecasecentre.org.INVALID> on 2025/07/10 14:56:37 UTC
Problem with using Overlay - specific pages
Hi everyone,
First post! Hope I'm doing it right :-)
I've been trying to apply a one-page overlay to specific pages in a source PDF.
At the moment, I'm reading the source and the overlay in using Loader.loadPDF() and then using the multipdf.Overlay class to first of all setInputFile() and then setOverlayPosition().
I'm constructing a Map<Integer,String> correctly (missing a couple of page numbers out) and then passing that in to overlay() - without any errors on the call.
I'm then .save() ing the result of that and using close() correctly.
(I'll explain why I don't just post the code in a minute!)
If I do this, my resultant PDF is generated as a copy of the original, no sign of the overlay.
If I do setAllPagesOverlayPDF(document), the overlay appears on every page, without missing any pages.
I've also tried setDefaultOverlayPDF() with the same result.
The reason I don't just post my code is that I'm trying to do this from Lucee (CFML). This hasn't been a problem when applying watermarks using a content stream, and that's all fine and lovely, so I'm 95% sure I'm calling the Java code correctly.
It's just this darned Overlay stuff that doesn't seem to work! I've Googled a lot and used other examples to construct the code, so either everyone's wrong (unlikely) or I am!
Does anyone have any idea as to whether I'm just not using something correctly, or if it's just not possible/not the idea in the first place?
Hope someone out there in the ether can help! :-)
Best wishes,
--
Mike Horne
Re: Problem with using Overlay - specific pages
Posted by Tilman Hausherr <TH...@t-online.de>.
On 7/11/2025 9:40 AM, Michael Horne wrote:
> Got it. Thanks Tilman!
> Will let you know if I manage to figure out how to see the debug! 🙂
It's just an output to the standard output. You don't have to activate
anything. You can also see it if you run the tool by itself.
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Michael Horne <mi...@thecasecentre.org.INVALID>.
Ah! Got it! :-)
That bit of debug it spat out indicated a problem with what I was passing from Lucee into the overlay() call.
It turns out that a regular Lucee/CFML struct defined with numeric keys are actually strings! So it couldn't figure out what to do with the keys (structs are Maps in the Java world).
What I've ended up doing is creating a LinkedHashMap (which is compatible with the Map<Integer,String> type for overlay())
<cfset local.guide = createObject("java", "java.util.LinkedHashMap").init()>
And then using the put() method on the object with a cast Integer as the key and a string (the overlay path) as the value:
<cfset local.guide.put(javaCast("integer", local.i+1), arguments.overlay_path)>
And lo and behold, the overlay() call no longer errors and I get what I wanted.
I couldn't be more delighted!
Thank you Tilman, for the verbose version and the help! Who knew Lucee was so finicky! ;-)
--
Mike
________________________________
From: Michael Horne <mi...@thecasecentre.org.INVALID>
Sent: 11 July 2025 08:51
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from mike@thecasecentre.org.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Interesting!
That version throws an error:
class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
at Overlay.java, line 132.
I wonder if there's something fundamentally problematic about data types in the Lucee part and the non-verbose version just ignores it and throws its hands up and says "no"?
--
Mike
________________________________
From: Michael Horne <mi...@thecasecentre.org.INVALID>
Sent: 11 July 2025 08:40
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from mike@thecasecentre.org.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Got it. Thanks Tilman!
Will let you know if I manage to figure out how to see the debug! 🙂
--
Mike
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: 11 July 2025 08:35
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Hi,
Use this version:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.6-SNAPSHOT/pdfbox-app-3.0.6-20250711.072333-59.jar
please tell when you've downloaded it so that revert these changes.
Tilman
On 7/11/2025 8:53 AM, Michael Horne wrote:
> Hi Tilman,
> That is the call I'm making, yes.
>
> Oooh. Interesting! I've just tried with the command line version documented here:
> https://pdfbox.apache.org/3.0/commandline.html
>
> and THAT works nicely. I can create a new PDF with specific pages overlaid.
> So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
>
> Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
>
> Hmm. I'm unsure how to make a verbose snapshot.
>
> I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
>
> Thanks for your help thus far. Will come back with some results if I can make it do what I want!
>
> --
> Mike
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: 10 July 2025 19:46
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Here's what I could do:
> I'd create a verbose snapshot version that will tell whether it was
> called at all and what pages were handled.
>
> I assume you're using this call:
> public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
>
> The output would look like this (that's from the unit test)
>
> specificPageOverlayMap:
> {1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
> 2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
> 3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
> 4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
> specificPageOverlayLayoutPageMap:
> {1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
> 2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
> 3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
> 4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
> processing page: 0
> processing page: 0, done
> processing page: 1
> processing page: 1, done
> processing page: 2
> processing page: 2, done
> processing page: 3
> processing page: 3, done
>
>
> Tilman
>
> On 7/10/2025 7:27 PM, Michael Horne wrote:
>> Sorry, yes that would help.
>>
>> I'm on 3.0.5 and I'm using the app JAR file.
>>
>> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>>
>> Mike
>>
>> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
>> ________________________________
>> From: Tilman Hausherr <TH...@t-online.de>
>> Sent: Thursday, July 10, 2025 6:09:26 PM
>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>> Subject: Re: Problem with using Overlay - specific pages
>>
>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Hi,
>>
>> Please tell what PDFBox version you're using. Are you able to simulate
>> the calls without using Lucee and what happens then? Are you using a jar
>> file or are you using maven?
>>
>> Tilman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Tilman Hausherr <TH...@t-online.de>.
On 7/11/2025 9:51 AM, Michael Horne wrote:
> Interesting!
> That version throws an error:
> class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
>
> at Overlay.java, line 132.
>
> I wonder if there's something fundamentally problematic about data types in the Lucee part and the non-verbose version just ignores it and throws its hands up and says "no"?
This is weird, the problematic line is one that hasn't been changed, and
it should have thrown an exception before too.
Anyway, I'm glad I could help!
Tilman
>
> --
> Mike
> ________________________________
> From: Michael Horne <mi...@thecasecentre.org.INVALID>
> Sent: 11 July 2025 08:40
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from mike@thecasecentre.org.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Got it. Thanks Tilman!
> Will let you know if I manage to figure out how to see the debug! 🙂
> --
> Mike
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: 11 July 2025 08:35
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> Use this version:
> https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.6-SNAPSHOT/pdfbox-app-3.0.6-20250711.072333-59.jar
>
> please tell when you've downloaded it so that revert these changes.
>
> Tilman
>
> On 7/11/2025 8:53 AM, Michael Horne wrote:
>> Hi Tilman,
>> That is the call I'm making, yes.
>>
>> Oooh. Interesting! I've just tried with the command line version documented here:
>> https://pdfbox.apache.org/3.0/commandline.html
>>
>> and THAT works nicely. I can create a new PDF with specific pages overlaid.
>> So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
>>
>> Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
>>
>> Hmm. I'm unsure how to make a verbose snapshot.
>>
>> I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
>>
>> Thanks for your help thus far. Will come back with some results if I can make it do what I want!
>>
>> --
>> Mike
>> ________________________________
>> From: Tilman Hausherr <TH...@t-online.de>
>> Sent: 10 July 2025 19:46
>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>> Subject: Re: Problem with using Overlay - specific pages
>>
>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Here's what I could do:
>> I'd create a verbose snapshot version that will tell whether it was
>> called at all and what pages were handled.
>>
>> I assume you're using this call:
>> public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
>>
>> The output would look like this (that's from the unit test)
>>
>> specificPageOverlayMap:
>> {1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
>> 2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
>> 3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
>> 4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
>> specificPageOverlayLayoutPageMap:
>> {1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
>> 2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
>> 3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
>> 4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
>> processing page: 0
>> processing page: 0, done
>> processing page: 1
>> processing page: 1, done
>> processing page: 2
>> processing page: 2, done
>> processing page: 3
>> processing page: 3, done
>>
>>
>> Tilman
>>
>> On 7/10/2025 7:27 PM, Michael Horne wrote:
>>> Sorry, yes that would help.
>>>
>>> I'm on 3.0.5 and I'm using the app JAR file.
>>>
>>> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>>>
>>> Mike
>>>
>>> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
>>> ________________________________
>>> From: Tilman Hausherr <TH...@t-online.de>
>>> Sent: Thursday, July 10, 2025 6:09:26 PM
>>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>>> Subject: Re: Problem with using Overlay - specific pages
>>>
>>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>>
>>> Hi,
>>>
>>> Please tell what PDFBox version you're using. Are you able to simulate
>>> the calls without using Lucee and what happens then? Are you using a jar
>>> file or are you using maven?
>>>
>>> Tilman
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Michael Horne <mi...@thecasecentre.org.INVALID>.
Interesting!
That version throws an error:
class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
at Overlay.java, line 132.
I wonder if there's something fundamentally problematic about data types in the Lucee part and the non-verbose version just ignores it and throws its hands up and says "no"?
--
Mike
________________________________
From: Michael Horne <mi...@thecasecentre.org.INVALID>
Sent: 11 July 2025 08:40
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from mike@thecasecentre.org.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Got it. Thanks Tilman!
Will let you know if I manage to figure out how to see the debug! 🙂
--
Mike
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: 11 July 2025 08:35
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Hi,
Use this version:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.6-SNAPSHOT/pdfbox-app-3.0.6-20250711.072333-59.jar
please tell when you've downloaded it so that revert these changes.
Tilman
On 7/11/2025 8:53 AM, Michael Horne wrote:
> Hi Tilman,
> That is the call I'm making, yes.
>
> Oooh. Interesting! I've just tried with the command line version documented here:
> https://pdfbox.apache.org/3.0/commandline.html
>
> and THAT works nicely. I can create a new PDF with specific pages overlaid.
> So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
>
> Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
>
> Hmm. I'm unsure how to make a verbose snapshot.
>
> I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
>
> Thanks for your help thus far. Will come back with some results if I can make it do what I want!
>
> --
> Mike
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: 10 July 2025 19:46
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Here's what I could do:
> I'd create a verbose snapshot version that will tell whether it was
> called at all and what pages were handled.
>
> I assume you're using this call:
> public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
>
> The output would look like this (that's from the unit test)
>
> specificPageOverlayMap:
> {1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
> 2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
> 3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
> 4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
> specificPageOverlayLayoutPageMap:
> {1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
> 2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
> 3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
> 4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
> processing page: 0
> processing page: 0, done
> processing page: 1
> processing page: 1, done
> processing page: 2
> processing page: 2, done
> processing page: 3
> processing page: 3, done
>
>
> Tilman
>
> On 7/10/2025 7:27 PM, Michael Horne wrote:
>> Sorry, yes that would help.
>>
>> I'm on 3.0.5 and I'm using the app JAR file.
>>
>> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>>
>> Mike
>>
>> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
>> ________________________________
>> From: Tilman Hausherr <TH...@t-online.de>
>> Sent: Thursday, July 10, 2025 6:09:26 PM
>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>> Subject: Re: Problem with using Overlay - specific pages
>>
>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Hi,
>>
>> Please tell what PDFBox version you're using. Are you able to simulate
>> the calls without using Lucee and what happens then? Are you using a jar
>> file or are you using maven?
>>
>> Tilman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Michael Horne <mi...@thecasecentre.org.INVALID>.
Got it. Thanks Tilman!
Will let you know if I manage to figure out how to see the debug! 🙂
--
Mike
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: 11 July 2025 08:35
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Hi,
Use this version:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.6-SNAPSHOT/pdfbox-app-3.0.6-20250711.072333-59.jar
please tell when you've downloaded it so that revert these changes.
Tilman
On 7/11/2025 8:53 AM, Michael Horne wrote:
> Hi Tilman,
> That is the call I'm making, yes.
>
> Oooh. Interesting! I've just tried with the command line version documented here:
> https://pdfbox.apache.org/3.0/commandline.html
>
> and THAT works nicely. I can create a new PDF with specific pages overlaid.
> So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
>
> Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
>
> Hmm. I'm unsure how to make a verbose snapshot.
>
> I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
>
> Thanks for your help thus far. Will come back with some results if I can make it do what I want!
>
> --
> Mike
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: 10 July 2025 19:46
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Here's what I could do:
> I'd create a verbose snapshot version that will tell whether it was
> called at all and what pages were handled.
>
> I assume you're using this call:
> public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
>
> The output would look like this (that's from the unit test)
>
> specificPageOverlayMap:
> {1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
> 2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
> 3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
> 4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
> specificPageOverlayLayoutPageMap:
> {1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
> 2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
> 3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
> 4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
> processing page: 0
> processing page: 0, done
> processing page: 1
> processing page: 1, done
> processing page: 2
> processing page: 2, done
> processing page: 3
> processing page: 3, done
>
>
> Tilman
>
> On 7/10/2025 7:27 PM, Michael Horne wrote:
>> Sorry, yes that would help.
>>
>> I'm on 3.0.5 and I'm using the app JAR file.
>>
>> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>>
>> Mike
>>
>> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
>> ________________________________
>> From: Tilman Hausherr <TH...@t-online.de>
>> Sent: Thursday, July 10, 2025 6:09:26 PM
>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>> Subject: Re: Problem with using Overlay - specific pages
>>
>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Hi,
>>
>> Please tell what PDFBox version you're using. Are you able to simulate
>> the calls without using Lucee and what happens then? Are you using a jar
>> file or are you using maven?
>>
>> Tilman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Use this version:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.6-SNAPSHOT/pdfbox-app-3.0.6-20250711.072333-59.jar
please tell when you've downloaded it so that revert these changes.
Tilman
On 7/11/2025 8:53 AM, Michael Horne wrote:
> Hi Tilman,
> That is the call I'm making, yes.
>
> Oooh. Interesting! I've just tried with the command line version documented here:
> https://pdfbox.apache.org/3.0/commandline.html
>
> and THAT works nicely. I can create a new PDF with specific pages overlaid.
> So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
>
> Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
>
> Hmm. I'm unsure how to make a verbose snapshot.
>
> I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
>
> Thanks for your help thus far. Will come back with some results if I can make it do what I want!
>
> --
> Mike
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: 10 July 2025 19:46
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Here's what I could do:
> I'd create a verbose snapshot version that will tell whether it was
> called at all and what pages were handled.
>
> I assume you're using this call:
> public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
>
> The output would look like this (that's from the unit test)
>
> specificPageOverlayMap:
> {1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
> 2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
> 3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
> 4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
> specificPageOverlayLayoutPageMap:
> {1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
> 2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
> 3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
> 4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
> processing page: 0
> processing page: 0, done
> processing page: 1
> processing page: 1, done
> processing page: 2
> processing page: 2, done
> processing page: 3
> processing page: 3, done
>
>
> Tilman
>
> On 7/10/2025 7:27 PM, Michael Horne wrote:
>> Sorry, yes that would help.
>>
>> I'm on 3.0.5 and I'm using the app JAR file.
>>
>> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>>
>> Mike
>>
>> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
>> ________________________________
>> From: Tilman Hausherr <TH...@t-online.de>
>> Sent: Thursday, July 10, 2025 6:09:26 PM
>> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
>> Subject: Re: Problem with using Overlay - specific pages
>>
>> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> Hi,
>>
>> Please tell what PDFBox version you're using. Are you able to simulate
>> the calls without using Lucee and what happens then? Are you using a jar
>> file or are you using maven?
>>
>> Tilman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Michael Horne <mi...@thecasecentre.org.INVALID>.
Hi Tilman,
That is the call I'm making, yes.
Oooh. Interesting! I've just tried with the command line version documented here:
https://pdfbox.apache.org/3.0/commandline.html
and THAT works nicely. I can create a new PDF with specific pages overlaid.
So it IS capable of doing what I want, but only from the command line. But it's the same JAR. Confusing!
Which kinda leads me to think I'm doing something specifically wrong in the Lucee/CFML version.
Hmm. I'm unsure how to make a verbose snapshot.
I think I'll try using Maven (https://docs.lucee.org/recipes/maven.html) rather than the direct JAR and see if that produces a different result.
Thanks for your help thus far. Will come back with some results if I can make it do what I want!
--
Mike
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: 10 July 2025 19:46
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Here's what I could do:
I'd create a verbose snapshot version that will tell whether it was
called at all and what pages were handled.
I assume you're using this call:
public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
The output would look like this (that's from the unit test)
specificPageOverlayMap:
{1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
specificPageOverlayLayoutPageMap:
{1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
processing page: 0
processing page: 0, done
processing page: 1
processing page: 1, done
processing page: 2
processing page: 2, done
processing page: 3
processing page: 3, done
Tilman
On 7/10/2025 7:27 PM, Michael Horne wrote:
> Sorry, yes that would help.
>
> I'm on 3.0.5 and I'm using the app JAR file.
>
> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>
> Mike
>
> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: Thursday, July 10, 2025 6:09:26 PM
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> Please tell what PDFBox version you're using. Are you able to simulate
> the calls without using Lucee and what happens then? Are you using a jar
> file or are you using maven?
>
> Tilman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Tilman Hausherr <TH...@t-online.de>.
Here's what I could do:
I'd create a verbose snapshot version that will tell whether it was
called at all and what pages were handled.
I assume you're using this call:
public PDDocument overlay(Map<Integer, String> specificPageOverlayMap)
The output would look like this (that's from the unit test)
specificPageOverlayMap:
{1=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot0.pdf,
2=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot90.pdf,
3=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot180.pdf,
4=pdfbox\src\test\resources\org\apache\pdfbox\multipdf\rot270.pdf}
specificPageOverlayLayoutPageMap:
{1=org.apache.pdfbox.multipdf.Overlay$LayoutPage@7f5c94e6,
2=org.apache.pdfbox.multipdf.Overlay$LayoutPage@761fc90d,
3=org.apache.pdfbox.multipdf.Overlay$LayoutPage@493f56b,
4=org.apache.pdfbox.multipdf.Overlay$LayoutPage@3620308c}
processing page: 0
processing page: 0, done
processing page: 1
processing page: 1, done
processing page: 2
processing page: 2, done
processing page: 3
processing page: 3, done
Tilman
On 7/10/2025 7:27 PM, Michael Horne wrote:
> Sorry, yes that would help.
>
> I'm on 3.0.5 and I'm using the app JAR file.
>
> I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
>
> Mike
>
> Sent from Outlook for Android<https://aka.ms/AAb9ysg>
> ________________________________
> From: Tilman Hausherr <TH...@t-online.de>
> Sent: Thursday, July 10, 2025 6:09:26 PM
> To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
> Subject: Re: Problem with using Overlay - specific pages
>
> [You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> Please tell what PDFBox version you're using. Are you able to simulate
> the calls without using Lucee and what happens then? Are you using a jar
> file or are you using maven?
>
> Tilman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Michael Horne <mi...@thecasecentre.org.INVALID>.
Sorry, yes that would help.
I'm on 3.0.5 and I'm using the app JAR file.
I can't really - my Java knowledge is appalling. I could maybe cobble it together but not sure it'd be very accurate!
Mike
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Tilman Hausherr <TH...@t-online.de>
Sent: Thursday, July 10, 2025 6:09:26 PM
To: users@pdfbox.apache.org <us...@pdfbox.apache.org>
Subject: Re: Problem with using Overlay - specific pages
[You don't often get email from thausherr@t-online.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Hi,
Please tell what PDFBox version you're using. Are you able to simulate
the calls without using Lucee and what happens then? Are you using a jar
file or are you using maven?
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Problem with using Overlay - specific pages
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Please tell what PDFBox version you're using. Are you able to simulate
the calls without using Lucee and what happens then? Are you using a jar
file or are you using maven?
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org