HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Automatically open print dialog
- This topic has 5 replies, 2 voices, and was last updated Mar 14, 2010
02:35:16 byPD4ML.
-
AuthorPosts
-
January 6, 2010 at 19:28#26293
I would like to know if it is possible to create a pdf file which we open, and the print dialog automatically opens too. It is said in the release notes that this functionality is already implemented.
If so, what is the JSP taglib equivalent to do so? Is it in the “permissions” tag?
Could you show me an example of usage?January 7, 2010 at 15:16#27651In Java code it can be done like that:
Map m = new HashMap(); m.put(PD4Constants.PD4ML_PRINT_DIALOG_POPUP, "true"); pd4ml.setDynamicParams(m);
Unfortunately there is still no JSP taglib mapping for the method. Please check if your JSP environments allows to locate
<pd4ml:transform>tag instance:
<% org.zefer.pd4ml.taglib.PD4MLTransformerTag trt = (org.zefer.pd4ml.taglib.PD4MLTransformerTag) pageContext.getAttribute( "pd4ml.transformer.tag", javax.servlet.jsp.PageContext.REQUEST_SCOPE ); if ( trt != null ) { System.out.println("found"); } %>If it works you’ll be able to pass the dynamic params map to it
trt.setDynamicParams(m);
with the forthcoming PD4ML beta (v360b2).
The missing mapping custom tags (
<pd4ml:params>,<pd4ml:key>,<pd4ml:value>) for the method will be available with the final release v360.January 13, 2010 at 02:43#27652@PD4ML wrote:
The missing mapping custom tags (
<pd4ml:params>,<pd4ml:key>,<pd4ml:value>) for the method will be available with the final release v360.Thanks! although i think that the tags are
<pd4ml:parameters>and<pd4ml:parameter>The following code works for me:
<br /> <pdf:transform screenWidth="800" adjustScreenWidth="true" pageFormat="LETTER" pageOrientation="portrait"<br /> pageInsets="3,3,3,3,mm" enableImageSplit="false" inline="true"<br /> fileName="file.pdf" interpolateImages="false"><br /> <pdf:parameters><br /> <pdf:parameter key="pd4ml.print.dialog.popup" value="true"></pdf:parameter><br /> </pdf:parameters><br /> <html><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /> <title>JSP Page</title><br /> </head><br /> <body><br /> <h1>Hello World!</h1><br /> </body><br /> </html><br /> </pdf:transform><br />January 13, 2010 at 02:54#27653Any chance to send the converted document directly to the printer?
I mean, do not open a viewer and display the print dialog box, but print it directly.January 13, 2010 at 11:27#27654@wilvec wrote:
although i think that the tags are
<pd4ml:parameters>and<pd4ml:parameter>Right, we changed my initial idea with the tag naming and managed to implement the feature in v360b2
March 14, 2010 at 02:35#27655@wilvec wrote:
Any chance to send the converted document directly to the printer?
I mean, do not open a viewer and display the print dialog box, but print it directly.The only way to print PDF silently is to run something like that on the client machine:
AcroRd32.exe /t “C:document.pdf” “HP LaserJet 3300 Series PCL 6” “HP LaserJet 3300 Series PCL” “DOT4_001”
or
AcroRd32.exe /t “C:document.pdf” “\serverprintername” “Kyocera FS-1010” “192.168.0.1”
For network printers sometimes it works without driver/port names:
AcroRd32.exe /t “C:document.pdf” “\serverprintername”Of course the above is not usable for web application scenarios. In web applications (running acroread as a browser plugin) the silent print cannot be done for security reason.
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
