pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Can't add multiple form XObjects to a PDF - they become duplicated
Date Thu, 10 Jan 2013 11:34:54 GMT

looks like it is a bug. Could you open an issue at  https://issues.apache.org/jira/browse/PDFBOX
and attach some sample code to reproduce as well as your PDF's for testing.

Kind regards

Maruan Sahyoun

Am 10.01.2013 um 09:28 schrieb SolidAndShade <solidandshade@fastmail.fm>:

> Hi everyone,
> I've been trying in vain to paste multiple small PDFs into a big one as
> form XObjects. I want to paste a bunch of little PDFs into a large one.
> This image illustrates what I'm trying to do:
> https://imageshack.us/photo/my-images/59/pdfsampleimagepasterigh.png/
> The Test 1-3 boxes would be the little PDFs I want to insert. When I try
> to do this, I get this result:
> https://imageshack.us/photo/my-images/15/pdfsampleimagepastewron.png/
> The last form to  be pastes is just duplicated three times. It seems
> that instead of adding multiple XObjects, I am just adding multiple
> references to a single XObject, and whenever I try to add another
> XObject it just overwrites the XObject that the form instances were
> referring to. It seems I can't insert multiple forms, just multiple
> references to a single one.
> I am using a variation of this code to paste the forms onto the PDF,
> using the LayerUtility class:
> LayerUtility lu = new LayerUtility( doc );
> PDXObjectForm form = lu.importPageAsForm( doc2, 0 );
> PDPage page = (PDPage) doc.getDocumentCatalog().getAllPages().get( 0 );
> lu.wrapInSaveRestore( page );
> AffineTransform at = new AffineTransform();
> lu.appendFormAsLayer( page, form, at, "new_layer_name" );
> It works great for pasting a single PDF onto another, but not for
> multiples.
> Does anyone know what I'm doing wrong? Any help is appreciated. Thanks.
> -- 
> http://www.fastmail.fm - A no graphics, no pop-ups email service

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