Re: PDF/Postscript in gtk+



Raul Dias wrote:
Hi,

I need to display pdf documents (PDF::Api2 generated documents) inside a
perl-gtk+ app.

This app will be cross plataform (linux/windows).

Do you have to have the pdf rendered inside your app, or is opening an external app OK?

I do this:

---

if ($^O eq "linux") {
$browser = `which firefox` || `which mozilla`; chomp($browser); # Remove stray linefeed ( or something ) character
   $pdf_viewer = `which acroread || `which evince` || `which gpdf`;
chomp($pdf_viewer); # Remove stray linefeed ( or something ) character
   $report_dir = $currentdir . "/.sales/reports/";
} elsif ($^O eq "MSWin32") { $browser = 'C:\Progra~1\Mozill~1\firefox.exe'; # Yuck. DOS. $pdf_viewer = '"C:\\Program Files\\Adobe\\Acrobat 7.0\\Reader\\AcroRd32.exe"';
   $report_dir = 'C:\\.sales\\reports\\';
}

---

evince and gpdf can't currently print pdfs very well at all. They have major issues with spacing and alignment - particularly with pdfs generated by PDF::API2 ... trust me ... this is just what we do :(

So I default to Adobe's Acrobat reader under Linux & Windows. It works fine, but is a little slow to load, and it doesn't have a print dialog that lets you select a printer, so I also install 'gtklp', and use the 'print to a custom command' option from acroread - which 'prints' to gtklp, which in turn gives you *stacks* of handy options like which printer you want to print to :) If you don't have to print, but only view, then take your pick out of evince ( slow but better interface ), or gpdf.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]