From: Mike S. <Mik...@Do...> - 2007-04-06 00:08:06
|
Thanks for the great ideas - I learned a lot for your "kludges". :) Mark Dootson wrote: > Hi, > > After writing the last reply, a huge kludge occurred to me that, as it turns out, works just fine. > > use Wx::ActiveX::IE > pass it the URL of your pdf, and print merrily. > e.g. > > my $obj = Wx::ActiveX::IE->new( $frame , -1, wxDefaultPosition , wxDefaultSize ); > $obj->LoadUrl("file:///C:/mytest.pdf"); > $obj->Print(0); # for no print dialog > $obj->Print(1); # for print dialog > > Of course, loading IE and the Acrobat plugin may seem a little excessive just to print a doc, but heck, this is windows and four lines of code is pretty impressive. > > Mark > > > Mark Dootson wrote: > >> Just as an F.Y.I. >> >> I once had the idea that I could open a PDF in Wx::ActiveX::Acrobat >> control in a hidden Frame and simply call its Print method. >> >> Alas, I have never been able to get Wx::ActiveX::Acrobat to work or >> use Win32::OLE with acrobat reader. (Note, the free reader, NOT the >> full acrobat). I suspect its a version 7/8 thing as >> Wx::ActiveX::Acrobat will have worked originally. >> >> I was reduced to using the /p /h params to AcroRd32.exe >> >> (AcroRd32.exe /p /h my.pdf) >> >> For anyone who has not tried it, it works, but its ugly. The Acrobat >> instance does not close down after printing. (though it does close >> the document). But Acrobat always does this anyway. >> >> Of course, the problem might be behind the keyboard at this end >> rather than with Wx::ActiveX::Acrobat, so if anyone does have some >> working code, it would be nice to see it. >> >> Regards >> >> Mark >> >> >> >> Mike Schroeder wrote: >> >>> Not sure if this is an obvious question I am just missing or not, >>> but.... >>> >>> We generate server-side PDFs and then pass them to wxPerl clients. >>> By default we just open them with the appropriate mime-type >>> application on the client platform (so evince/xpdf on gtk, Preview >>> on OSX, Acrobat on Win32). >>> >>> The issue now is if we can print without having to open first. For >>> Linux and OSX, worst case we can just do a system call to "lp >>> filename.pdf" and everything is fine, but not sure how to print a >>> PDF in Win32 without first opening it in Acrobat. >>> >>> I noticed that Mark Wardell has wrapped wxPdfDocument, and that the >>> wxPdfDocument folks plan on providing a wxPdfDC (similar to >>> wxPostscriptDC) for printing in their next release -- is that the >>> way to go?? >>> >>> Thanks in advance for any insight/suggestions. >>> >>> Mike. >>> >>> ------------------------------------------------------------------------- >>> Take Surveys. Earn Cash. Influence the Future of IT Join >>> SourceForge.net's Techsay panel and you'll get the chance to share >>> your opinions on IT & business topics through brief surveys-and >>> earn cash >>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >>> _______________________________________________ wxperl-users >>> mailing list wxp...@li... >>> https://lists.sourceforge.net/lists/listinfo/wxperl-users >>> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT Join >> SourceForge.net's Techsay panel and you'll get the chance to share >> your opinions on IT & business topics through brief surveys-and earn >> cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ wxperl-users mailing >> list wxp...@li... >> https://lists.sourceforge.net/lists/listinfo/wxperl-users >> > > > |