in reply to PDF::Tk Background Image

From looking at the source of PDF::Tk, I think you should be able to use it like this (completely untested!)
use PDF::Tk; my $pdftk=PDF::Tk->new(pdftk=>'/usr/bin/pdftk'); ... # instead of filling @pdfLines from <POUT> my $pdf_with_bg = ""; # to be filled by pdftk my $pdf_in_memory; { local $/ = undef; $pdf_in_memory = <POUT>; } # whole file as one big + string $pdftk->call_pdftk(\$pdf_in_memory, \$pdf_with_bg, 'background', '/pat +h/to/background.pdf'); print "Content-Type: application/pdf\n"; print "Content-Disposition: attachment; filename=record.pdf\n\n"; print $pdf_with_bg;

Replies are listed 'Best First'.
Re^2: PDF::Tk Background Image
by qwertywolf (Initiate) on Oct 25, 2016 at 16:35 UTC
    EEEEEEEEE!!!! THIS WORKS!!! OMG I AM SO HAPPY!!! Okay, there is just one issue and I hope it's a small one. My generated text, has a white background that I can't seem to make transparent because the PDF ignores all of my CSS. Any ideas?
      Huh? Transparent background? What would you want to see through that?
      Or is it the "foreground" that is non-transparent? Then perhaps your first step (html2ps or ps2pdf) explicitly sets the background color to "white". Try to omit that.

      Update: from what I could google about html2ps, it defaults to a white background, so you'd have to modify your html2psrc-tst file.
      If you're doing this anyway, perhaps you can integrate the new background there, so that you eliminate the need for PDF::Tk …

      I don't think PDF supports transparent backgrounds... Perhaps you want to make a .png file?
        I am using html2ps so I think it's a ps file before it's a pdf when I merge it with a watermark.