PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Automatically open print dialog
   PostPosted: 06 Jan 2010, 21:28 
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?


  Subject: Re: Automatically open print dialog
   PostPosted: 07 Jan 2010, 17:16 
In 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.


  Subject: Re: Automatically open print dialog
   PostPosted: 13 Jan 2010, 04:43 
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:
Code:
<pdf:transform screenWidth="800" adjustScreenWidth="true" pageFormat="LETTER" pageOrientation="portrait"
   pageInsets="3,3,3,3,mm" enableImageSplit="false" inline="true"
   fileName="file.pdf" interpolateImages="false">
   <pdf:parameters>
      <pdf:parameter key="pd4ml.print.dialog.popup" value="true"></pdf:parameter>
   </pdf:parameters>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <title>JSP Page</title>
   </head>
   <body>
      <h1>Hello World!</h1>
   </body>
</html>
</pdf:transform>


  Subject: Re: Automatically open print dialog
   PostPosted: 13 Jan 2010, 04:54 
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.


  Subject: Re: Automatically open print dialog
   PostPosted: 13 Jan 2010, 13:27 
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


  Subject: Re: Automatically open print dialog
   PostPosted: 14 Mar 2010, 04:35 
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" "\\server\printername" "Kyocera FS-1010" "192.168.0.1"

For network printers sometimes it works without driver/port names:
AcroRd32.exe /t "C:\document.pdf" "\\server\printername"

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.


Last bumped by Anonymous on 14 Mar 2010, 04:35.



[Reply]     [ 6 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share