Hi,
I did some work on embedding SWF into PDF, and I hit a printing issue -
not that it was not being printed, but its size was incorrect.
I got help from Adobe to clarify why this was happening; the following
link might be useful:
http://blogs.adobe.com/pdfdevjunkie/2008/09/how_do_you_create_swf_files_
fo.html
Regards,
________________________________
From: Geoff Cook [mailto:geoff.c...@eis-one.com]
Sent: 13 May 2009 07:58
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] missing setflags method in itextsharp
Hi there,
I'm using the latest itextsharp libraries (4.1.2) to add SWF content to
a PDF.
// create an output file stream which will be used to capture the
generated file
string outputFileName = outputDirectoryTextBox.Text +
@"\output.pdf";
FileStream outputFile = new FileStream(outputFileName,
FileMode.Create);
// open the original pdf file as a PdfReader
PdfReader reader = new PdfReader(pdfFileTextBox.Text);
// open the output pdf file as a PdfStamper
PdfStamper stamper = new PdfStamper(reader, outputFile);
// inserts a blank page at the start of the document
stamper.InsertPage(1, PageSize.A4);
// add the flash file to the output document as an annotation
PdfFileSpecification fs =
PdfFileSpecification.FileEmbedded(stamper.Writer, flashFileTextBox.Text,
flashFileTextBox.Text, null);
PdfAnnotation flashInsert =
PdfAnnotation.CreateScreen(stamper.Writer, new
Rectangle(50f,791f,545f,420f),"Flash Insert",fs,
"application/x-shockwave-flash", true);
The SWF appears in the pdf ok, but does not print.
I note some flags need to be changed to enable printing, and that the
PdfAnnotation.setFlags(int flags) method doesn't seem to exist in my
library (although it is used in other places on the web).
In the absence of this, I'm writing to the public flags variable for the
annotation as follows:
flashInsert.Flags = PdfAnnotation.FLAGS_PRINT;
stamper.AddAnnotation(flashInsert,1);
stamper.Close();
reader.Close();
However the annotation still doesn't print. To test whether the flags
are working, I tried (in the above):
flashInsert.Flags = PdfAnnotation.FLAGS_HIDDEN;
And when I opened the resultant PDF file, the SWF was still there. So
changing the flags doesn't seem to work.
Any ideas?
Thanks,
Geoff
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
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/