You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Nicola Farina <fa...@multidialogo.it> on 2024/03/19 14:46:57 UTC

Performance advice

Hi

I am using PDFBOX 2.0.30.
I need to build a sort of "filled" pdf starting from a template.
At the moment I've chosen to start with a "background" PDF and then
use PDFBOX to write on it
(see the attached examples).
The empty template pdf is basically a background image imported into a PDF.
I now wonder if it could be more efficient to start creating a new,
empty, PDF and then importing the image into it, and then write text
above all.
This application should be as fast as possible.

thanks for any tips/ideas
Nicola


Re: Performance advice

Posted by Nicola Farina <fa...@multidialogo.it>.
The image is in JPEG format.
Actually, though, the project starts loading a PDF with the image
already saved into it.
Thanks for you support
Nicola

Il giorno sab 6 apr 2024 alle ore 15:43 Tilman Hausherr
<TH...@t-online.de> ha scritto:
>
> Is the image already compressed, e.g. PNG, JPEG and b/w TIFF? Then use
> the image directly because PDFBox can use these formats without doing a
> compression, if you use the static methods from PDImageXObject.
>
> Or is the image in memory, or from a different format (e.g. color CCITT,
> GIF)? Then you'd save the compression time by creating a PDF that has
> the image in compressed form.
>
> Tilman
>
> On 19.03.2024 15:46, Nicola Farina wrote:
> > Hi
> >
> > I am using PDFBOX 2.0.30.
> > I need to build a sort of "filled" pdf starting from a template.
> > At the moment I've chosen to start with a "background" PDF and then
> > use PDFBOX to write on it
> > (see the attached examples).
> > The empty template pdf is basically a background image imported into a PDF.
> > I now wonder if it could be more efficient to start creating a new,
> > empty, PDF and then importing the image into it, and then write text
> > above all.
> > This application should be as fast as possible.
> >
> > thanks for any tips/ideas
> > Nicola
> >
> >
> > ---------------------------------------------------------------------
> > 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: Performance advice

Posted by Tilman Hausherr <TH...@t-online.de>.
Is the image already compressed, e.g. PNG, JPEG and b/w TIFF? Then use 
the image directly because PDFBox can use these formats without doing a 
compression, if you use the static methods from PDImageXObject.

Or is the image in memory, or from a different format (e.g. color CCITT, 
GIF)? Then you'd save the compression time by creating a PDF that has 
the image in compressed form.

Tilman

On 19.03.2024 15:46, Nicola Farina wrote:
> Hi
>
> I am using PDFBOX 2.0.30.
> I need to build a sort of "filled" pdf starting from a template.
> At the moment I've chosen to start with a "background" PDF and then
> use PDFBOX to write on it
> (see the attached examples).
> The empty template pdf is basically a background image imported into a PDF.
> I now wonder if it could be more efficient to start creating a new,
> empty, PDF and then importing the image into it, and then write text
> above all.
> This application should be as fast as possible.
>
> thanks for any tips/ideas
> Nicola
>
>
> ---------------------------------------------------------------------
> 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