Felipe Roos da Rosa wrote:
> 1T3XT info wrote:
>> A Form XObject also has a Resources 
>> dictionary referring to Font objects, other XObjects, etc...
>>
>> That makes it very difficult to achieve what you need.
> 
> So, I suppose that's what addTemplate from PdfContentByte does, right?

No, addTemplate only adds the content stream.
The resources are added at an earlier stage:
remember how you always have to use a writer object
when you use getImportedPage()?

At that moment the resources are already copied to
the writer.

This is why you can't use a PdfTemplate obtained from
one writer for any other writer...

> Based on some samples, I was using that to place the imported page.
> 
> What if I use 
> 
>                 Image img = Image.getInstance(importedPage);
> 
> will that image be the imported page image?

That image will be a vector data image consisting of a stream
of PDF syntax. However: the img object doesn't have the resources.
As mentioned above: those resources are already copied to the writer;

> If so, would I be able to put that stream into the PDF and insert it directly 
> on the page dictionary? 

Now that I think of it: as the resources are already copied,
it may be possible to use PdfImage! I don't have the time to
check this right now, but PdfImage extends PdfStream.
It's the object used by iText internally.

See for instance:
http://itextpdf.com/examples/index.php?page=example&id=285

Your requirement calls for a Proof of Concept in the form of
an interesting example on itextpdf.com. Maybe you can already start
and share this example. If it doesn't work, I'll take a look at it
after work.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to