Hoping someone can help me with a, what I hope is silly question with a simple answer. I've googled for a couple of hours now and I just don't get it and i'm failing to find an answer

All i'm wanting to do is set the background color of the entire page to a specific hex color. I don't want white I would like to set the page color to #FAF8CC to start with, might turn it down a little further

Here is the first few lines of code

my $pdf = PDF::API2->new(-file => "$SavedAttachment"); $pdf->mediabox(595,842); my $page = $pdf->page; my $fnt = $pdf->corefont('Arial',-encode => 'latin1'); my $txt = $page->text; $txt->textstart; ###### Logo at top center of page # my $image_02 = $page->gfx; my $image_file = $pdf->image_gif("$Logo"); $image_02->image( $image_file, 260,745,72,72 ); ###### Add Customer Name and Address # $txt->font($fnt, 8); $txt->translate(25,630); $txt->fillcolor('black'); $txt->text("$FullCustName");

In reply to setting PDF background color by akwe-xavante

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.