i'm trying to use stamper.addFileAttachment()
not sure exactly how to deal with PdfFileSpecification
extperimenting with this code, but getting NullPointerException...
public class MakePackage {
public static void main(String args[]) {
String pdfFiles[] = {
"C:\\60 pdfs\\0012432-in-phonoscope communications.pdf",
"C:\\60 pdfs\\0192630-in-sms systems maint.pdf",
"C:\\60 pdfs\\050406-sts#us044a.pdf"
};
try {
PdfReader reader = new PdfReader("C:\\60 pdfs\\small doc.pdf");
FileOutputStream outputStream = new
FileOutputStream("c:\\test.package.pdf");
PdfStamper stamp = new PdfStamper(reader, outputStream);
Document document = new
Document(reader.getPageSizeWithRotation(1));
PdfWriter attachment = new PdfCopy(document, outputStream);
PdfFileSpecification pdfAttch =
PdfFileSpecification.fileEmbedded(attachment, pdfFiles[0], pdfFiles[0],
null);
stamp.addFileAttachment("Attch1", pdfAttch);
outputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
----- Original Message -----
From: "Leonard Rosenthol" <[EMAIL PROTECTED]>
To: "Post all your questions about iText here"
<[email protected]>
Sent: Tuesday, December 19, 2006 4:52 PM
Subject: Re: [iText-questions] iText 1.4.8
> stamper.addFileAttachment().
>
> Here is my makePackage sample until Bruno cleans it up for the real
> world.
>
> LDR
>
--------------------------------------------------------------------------------
> On Dec 19, 2006, at 5:31 PM, Yuri Dumchikov wrote:
>
>> Yeah, an example for makePackage will be usefull.
>> I understood I need to create a pdf with attachments and convert it
>> to a
>> package.
>> So far I could not figure it out how to add attachments (existing
>> pdf's) to
>> a pdf.
>>
>> ----- Original Message -----
>> From: "Bruno Lowagie (iText)" <[EMAIL PROTECTED]>
>> To: "Post all your questions about iText here"
>> <[email protected]>
>> Sent: Tuesday, December 19, 2006 6:06 AM
>> Subject: [iText-questions] iText 1.4.8
>>
>>
>>> Hello all,
>>> iText 1.4.8 was released; the changelog was already posted yesterday.
>>> I'll let you know when the makePackage example is available.
>>> br,
>>> Bruno
>>>
>>> ---------------------------------------------------------------------
>>> ----
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to
>>> share
>>> your
>>> opinions on IT & business topics through brief surveys - and earn
>>> cash
>>> http://www.techsay.com/default.php?
>>> page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> iText-questions mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>>
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>> ----------------------------------------------------------------------
>> ---
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?
>> page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> iText-questions mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>
>
--------------------------------------------------------------------------------
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--------------------------------------------------------------------------------
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/