Hi,
Doesn't anybody know how to do this, or am I asking some obvious question
that's been asked before.. sorry if that's the case.
I'm trying to find out a way to add some javascript to an existing pdf file
that will open up an alert as well as open up a url in the users browser when
the pdf file is closed.
I have managed to add javascript code using the pdfstamper that opens up an
alert when the file loads. Could someone please send me a code snippet that can
do the same when the file is closed.
Here is my code using stamper to show a javascript alert when the file is
opened.
Dim p As New PdfReader("c:\a.pdf")
Dim s As New PdfStamper(p, New FileStream("c:\b.pdf", FileMode.Create))
s.JavaScript = "app.alert(""Javascript Alert!"");"
s.Close()
I tried extending the PdfPageEventHelper but the onOpenDocument method
uses the pdfwriter and document as arguments, so if I use the writer then
it assumes that its a new document, where as I need the code added to an
existing file.
Thanks
[EMAIL PROTECTED] wrote: Send iText-questions mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of iText-questions digest..."
Today's Topics:
1. Re: Reducing memory for JAI-ImageIO images (Paulo Soares)
2. Re: Adding monochrome image as gray (Paulo Soares)
3. IText problem with images ([EMAIL PROTECTED])
4. Re: IText problem with images (Paulo Soares)
5. How to add Arabic text to a PDF (dayvidpow)
6. Re: IText problem with images (geronimo ferreira)
7. Re: How to add Arabic text to a PDF (Bart Allen)
----------------------------------------------------------------------
Message: 1
Date: Thu, 19 Jul 2007 14:42:23 +0100
From: "Paulo Soares"
Subject: Re: [iText-questions] Reducing memory for JAI-ImageIO images
To: "Post all your questions about iText here"
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="utf-8"
Save it with JAI as a jpeg and use that jpeg in iText.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Schal?ck, Elmar
> Sent: Thursday, July 19, 2007 2:21 PM
> To: [email protected]
> Subject: [iText-questions] Reducing memory for JAI-ImageIO images
>
> Hi,
> it's a bit of off topic :-(
> I load an image (tiff multipage with old jpeg in tiff
> encoding) via JAI ImageIO.
> The resulting image is larger than the memory within the
> original tiff.
> So my resulting PDF is about twice the size of the original tiff file.
> Does anyone has any good idea about reducing the size?
>
> Thanks
> Elmar
Aviso Legal:
Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter
informa??o confidencial ou legalmente protegida. A incorrecta transmiss?o desta
mensagem n?o significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
------------------------------
Message: 2
Date: Thu, 19 Jul 2007 14:46:26 +0100
From: "Paulo Soares"
Subject: Re: [iText-questions] Adding monochrome image as gray
To: "Post all your questions about iText here"
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
This is something that I'll have to fix.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Allen Ziegenfus
> Sent: Tuesday, July 17, 2007 10:51 PM
> To: [email protected]
> Subject: [iText-questions] Adding monochrome image as gray
>
> We are looking at moving a bunch printing code from Postscript to PDF.
> We have a large set of monochrome CCITT TIFF images that are used on
> various documents. Some of these images need to be screened to appear
> gray. In Postscript I was able to accomplish this by adding a
> Decode to
> the image attributes like this:
>
> /Decode [GrayScaleValue 1.0]
>
> Our RIP then sees the gray and does its screening algorithm.
>
> I see that PDF also supports /Decode and I was able to insert
> a line of
> code into PdfImage.cs that does the job as follows.
>
> Put(PdfName.DECODE, new PdfLiteral("[0.5 1.0]"));
>
> Is there any "official" way to have iTextSharp output that or should I
> perhaps be thinking about this in a different way? I tried playing
> around with the "Additional" PDFDictionary object that you
> can set on an
> image, but the PdfImage.cs code bypasses that for CCITT images.
>
> Allen
>
>
> DISCLAIMER:
> This transmission contains information from Custom Direct,
> Inc. which may be confidential and/or privileged. The
> information is intended to be for the exclusive use of the
> planned recipient. If you are not the intended recipient, be
> advised that any disclosure, copying, distribution or other
> use of this information is strictly prohibited. If you have
> received this transmission in error, please notify the sender
> immediately.
>
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> 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/
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
------------------------------
Message: 3
Date: Thu, 19 Jul 2007 11:12:22 -0400
From: [EMAIL PROTECTED]
Subject: [iText-questions] IText problem with images
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8
Hi,
I am using itext to create dynamic web pdf.
For some reason when i add the
Image jpg = Image.getInstance("image.gif");
I get a ExceptionConverter: java.io.IOException: The document has no pages
error.
This works when i save it on a pdf locally, but it doesnt work when I try to do
it dynamically on a web, using bytearrayoutputstream.
--
This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com
http://www.opensubscriber.com/messages/[email protected]/topic.html
------------------------------
Message: 4
Date: Thu, 19 Jul 2007 17:02:38 +0100
From: "Paulo Soares"
Subject: Re: [iText-questions] IText problem with images
To: "Post all your questions about iText here"
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
It's probably throwing an exception that you are ignoring.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, July 19, 2007 4:12 PM
> To: [email protected]
> Subject: [iText-questions] IText problem with images
>
> Hi,
>
> I am using itext to create dynamic web pdf.
> For some reason when i add the
> Image jpg = Image.getInstance("image.gif");
> I get a ExceptionConverter: java.io.IOException: The document
> has no pages
> error.
>
> This works when i save it on a pdf locally, but it doesnt
> work when I try to do it dynamically on a web, using
> bytearrayoutputstream.
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
------------------------------
Message: 5
Date: Thu, 19 Jul 2007 10:25:00 -0700 (PDT)
From: dayvidpow
Subject: [iText-questions] How to add Arabic text to a PDF
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
How can i add Arabic text to a PDF and have it displayed in the PDF ?.
Currently i am using the following code however, this does not display the
Arabic characters:
BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252,
BaseFont.EMBEDDED);
column.addText(new Phrase(LINE_LEADING, arabicTitleStr , new
Font(bf,FONTSIZE_3)));
column.go();
Can anyone say what else will i need to do for this code to work? I am
following the example from the online Tutorial RightToLeft.java and
SayPeace.java.
--
View this message in context:
http://www.nabble.com/How-to-add-Arabic-text-to-a-PDF-tf4112571.html#a11693965
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------
Message: 6
Date: Thu, 19 Jul 2007 10:35:40 -0700 (PDT)
From: geronimo ferreira
Subject: Re: [iText-questions] IText problem with images
To: Post all your questions about iText here
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Thanks for the response but i found that the problem is the location of the
image.
For some reason is not reading the image when i put the image inside the
workspace(where i have all the source code), but it reads it if i put it
outside of the workspace..
sincerely
geronimo.
Paulo Soares
wrote: It's probably throwing an exception that you are ignoring.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, July 19, 2007 4:12 PM
> To: [email protected]
> Subject: [iText-questions] IText problem with images
>
> Hi,
>
> I am using itext to create dynamic web pdf.
> For some reason when i add the
> Image jpg = Image.getInstance("image.gif");
> I get a ExceptionConverter: java.io.IOException: The document
> has no pages
> error.
>
> This works when i save it on a pdf locally, but it doesnt
> work when I try to do it dynamically on a web, using
> bytearrayoutputstream.
Aviso Legal:
Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter
informa??o confidencial ou legalmente protegida. A incorrecta transmiss?o desta
mensagem n?o significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
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/
---------------------------------
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 7
Date: Thu, 19 Jul 2007 13:21:18 -0500
From: Bart Allen
Subject: Re: [iText-questions] How to add Arabic text to a PDF
To: Post all your questions about iText here
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii; format=flowed
Bruno has a great example of this in his SayPeace example in chapter 9
of his book.
Arabic glyphs are written as double byte chars.
Your encoding should be BaseFont.IDENTITY_H, and you should be using a
unicode font.
dayvidpow wrote:
> How can i add Arabic text to a PDF and have it displayed in the PDF ?.
> Currently i am using the following code however, this does not display the
> Arabic characters:
>
> BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252,
> BaseFont.EMBEDDED);
> column.addText(new Phrase(LINE_LEADING, arabicTitleStr , new
> Font(bf,FONTSIZE_3)));
> column.go();
>
> Can anyone say what else will i need to do for this code to work? I am
> following the example from the online Tutorial RightToLeft.java and
> SayPeace.java.
>
>
>
>
>
>
------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
End of iText-questions Digest, Vol 14, Issue 46
***********************************************
---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of spyware
protection. -------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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/