Jump to content

PDF_Lable.php got it to work with MySQL, but need PHP Generated CSS is the pdf


suttercain

Recommended Posts

Hi everyone,

 

I found a class online that allows you to convert an array to a PDF document, formating them for AVERY label. I got it working and have formatted them to fit with the 3170 template.

 

My issue is I would like to style the information that is being echoed in the pdf document. Currently it just takes the two lines of data and places them to the top/left.

 

I would like to Center the text text-align:center; and make one line of text larger.

 

Anyone know how to do this?

 

The info is being generated to the pdf labels via the sprintf() function:

 

$pdf = new PDF_Label('5160', 'in', 1, 2);

$pdf->Open();
$pdf->AddPage();

$sql = mysql_query("SELECT firmTitle, attendee FROM attendees") or die(mysql_error());
while ($row = mysql_fetch_array($sql)) {
// Print labels
    $pdf->Add_PDF_Label(sprintf("%s\n%s\n", ucwords($row['attendee']), $row['firmTitle']));

}
$pdf->Output();

 

Any advice? I know this is a tough one, but I am hoping someone may know.

 

SC

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.