Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

RE: [iText-questions] question

Paulo Soares

2005-08-17


Ah!

PdfReader reader = new PdfReader("my_pdf.pdf");
PdfWriter writer = ...;
PdfTemplate t = writer.getImportedPage(reader, 1);
Image img = Image.getInstance(t);

Use img as any other image.

> -----Original Message-----
> From: Patrick Janssen [mailto:p.janssen@(protected)]
> Sent: Wednesday, August 17, 2005 2:55 PM
> To: Paulo Soares
> Subject: RE: [iText-questions] question
>
> Sorry again,
>
>
> Maybe I've not been clearly enough.
> The code with the jpg-files functions well.
>
> What I really want to do is to put an external pdf-file (like
> "c://temp/photo" + i++ +".pdf"
> In a pdfcell
>
>
> Greetz
>
>
>
> -----Oorspronkelijk bericht-----
> Van: Paulo Soares [mailto:psoares@(protected)]
> Verzonden: woensdag 17 augustus 2005 9:18
> Aan: Patrick Janssen
> CC: itext-questions@(protected)
> Onderwerp: Re: [iText-questions] question
>
> If you use that PdfPCell conntructor with false then the cell
> width must be
> at least 160 + 2 * 10 = 180 to show the image.
>
> ----- Original Message -----
> From: "Patrick Janssen" <p.janssen@(protected)>
> To: "'Paulo Soares'" <psoares@(protected)>
> Sent: Wednesday, August 17, 2005 6:13 AM
> Subject: RE: [iText-questions] question
>
>
> >
> > Hi,
> >
> > Here's some I used to test with jpg
> >
> >
> > ListIterator lIterator = lList.listIterator();
> > int i = 1;
> > while (lIterator.hasNext()){
> > // search article
> > QueriedArticle qa = (QueriedArticle)(lIterator.next());
> > // add picture
> > Image image = Image.getInstance("c://temp/foto" + i++ +".jpg");
> > image.scaleAbsolute(160, 100);
> > cell = new PdfPCell(image,false);
> > cell.setPadding(10f);
> > // fill tabel
> >
> > table.addCell(cell);
> > table.addCell("Prijs : " + qa.getQA_Price() + "\n\nArtikel : " +
> > qa.getQA_articleName() + "\n"+ "Verkoper : " +
> qa.getQA_articleProducent()
> > + "\n\n" + "Adres : " + qa.getQA_street() + "\n" +
> qa.getQA_postnr() + " "
> +
> >
> > qa.getQA_city() + "\n\n" + "Vanaf : " +
> formatter.format(qa.getQA_dtFrom())
> > + "\n" + "Tot : "+formatter.format(qa.getQA_dtTo())) ;}
> > //add table
> > document.add(table);
> >
> > As you see I use an object of the class Image. When I want
> to import a
> > pdf-image I get an error
> >
> > I now have been looking to work around with Pdfcopy. I
> don't think this is
> > the solution.
> >
> >
> >
> > Thanks
> >
> >
> > pj
> >
> >
> >
> >
> > -----Oorspronkelijk bericht-----
> > Van: Paulo Soares [mailto:psoares@(protected)]
> > Verzonden: woensdag 17 augustus 2005 1:35
> > Aan: Patrick Janssen; itext-questions@(protected)
> > Onderwerp: Re: [iText-questions] question
> >
> > Yes, what's the problem?
> >
> > ----- Original Message -----
> > From: "Patrick Janssen" <p.janssen@(protected)>
> > To: <itext-questions@(protected)>
> > Sent: Tuesday, August 16, 2005 7:06 PM
> > Subject: [iText-questions] question
> >
> >
> > > Hi,
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > I'm been playing with images inside a table (mostly jpg-format)
> > >
> > >
> > >
> > > Now I want to put a pdf-image inside a pdf-cell.
> > >
> > >
> > >
> > > Is this possble??
> > >
> > >
> > >
> > >
> > >
> > > Greetz
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > P; Janssen
> > >
> > >
> >
> >
>
>
>
>
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.