|
Is there a way to embed a valid mime type file
without specifying the specific mime type?
I have an application that needed silent printing
for it's pdf's (thank you iText). It also has an "attachments" in which an
iframe is created with a src of a valid mime type file(image, Excel spreadshet,
etc), and an explorer object, which is used to print the contents of the
iframe. The problem is, the user still has to interact with a printer
dialog for these.
I'm wondering if I can use iText to circumvent this
problem by embedding the files in a pdf. I've searched the archives for
this group, and I have found example code that embeds mime type
files:
PdfFileSpecification fs =
PdfFileSpecification.fileEmbedded(writer, "saitoz-n.mpeg",
"saitoz-n.mpeg", null);
PdfAnnotation annot = PdfAnnotation.createScreen(writer,
new Rectangle(200f, 400f, 300f, 500f),
"saitoz-n.mpeg",fs,"video/mpeg",false);
writer.addAnnotation(annot);
However, it appears that it is necessary to specify
what the mime type is. This isn't the case with the browser
solution:
<body
>
<IFRAME style="visibility: visible" name="idFrame" width="100%" height="100%" src=""> </IFRAME> <object id="printWB" width=0 height=0
classid=""></object>
...
function
printFrame(frame)
{ frame.focus(); window.printWB.execWB(6, 6); window.printWB.outerHTML = ""; setTimeout("setPrintStatus(1)", 3000); } |
