pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Done <andrew.w.d...@gmail.com>
Subject Re: Possible coordinate space issue for field bounding box
Date Mon, 28 Nov 2016 17:59:04 GMT
Yep, that fixed it. Well played sir.

Is there a simple explanation you could fire at me so that I might
understand how this fixes it?

Thanks for your help. Very much appreciated.

On Mon, Nov 28, 2016 at 5:54 PM, Tilman Hausherr <THausherr@t-online.de>
wrote:

> I haven't tested it, but please try this first:
>
> change
>
> new PDPageContentStream(doc, page, AppendMode.APPEND, true);
>
> to
>
> new PDPageContentStream(doc, page, AppendMode.APPEND, true, true);
>
> Tilman
>
> Am 28.11.2016 um 18:24 schrieb Andrew Done:
>
>> Hi all,
>>
>> I have an issue that has plagued me for a couple of days; namely, I'm
>> trying to replace a field in a document with a rendered image, but that
>> image is NOT written to the point in the image I would hope.
>>
>> You can see a summary of this issue here:
>> https://github.com/ayuudee/issue-pad/tree/master/src/com/jesusthecat/pdf
>>
>> Specifically, note:
>>
>>     1. The files d1.pdf and d2.pdf have been processed through
>> Example.java
>>     to produce d1-out.pdf and d2-out.pdf respectively.
>>     2. Example.java is trying to place a 5x5 square in the bottom left
>>     corner of the red box (the field).
>>     3. The file d2.pdf has been generated from wkhtmltopdf and contains a
>>     single field 'foo'.
>>     4. The file d1.pdf is d2.pdf saved through PDF Studio (more on this
>>     below).
>>
>> The d1 pair demonstrates the behaviour I would expect. There is 5x5 box at
>> the bottom left corner of the field.
>>
>> The d2 pair does not, so something in the saving operation of PDF Studio
>> causes the box to be placed at the intended spot. More likely, I suppose
>> that something in the original d1.pdf is missing that is fixed by PDF
>> Studio.
>>
>> My questions are these:
>>
>>     1. What is the root cause of this issue? Is there a way that one can
>>     debug these sorts of issues?
>>     2. Is there a way I can change Example.java such that it could process
>>     d2.pdf (and PDF files similar to it) to produce a correct result;
>> that is,
>>     where the box is correctly positioned in the bottom left corner.
>>
>> Thanks for your help.
>>
>> Regards,
>> Andrew.
>>
>>
>


-- 
Andrew Done.
m: +44 7482 630 804

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message