Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dompdf image object

Posted on 2010-08-28
1
Medium Priority
?
549 Views
Last Modified: 2012-05-10
i am using following code to add page number and specific image to all pages in pdf.

$html .='<script type="text/php">
$font = Font_Metrics::get_font("verdana", "bold");
$pdf->page_text(270, 820, "Page {PAGE_NUM} of {PAGE_COUNT}", $font, 10, array(0,0,0));
$pdf->page_text(390, 820, "Copyright © RefCheck- All Rights Reserved", $font, 10, array(0,0,0));
$footer = $pdf->open_object();
$w = $pdf->get_width();
$h = $pdf->get_height();
$y = $h - 2 * $text_height - 24;
$pdf->line(16, $y, $w - 16, $y, $color, 1);
$pdf->image("http://localhost/ref_check/images/reference.png",".png",50,100,1050,150);
$pdf->close_object();
$pdf->add_object($footer, "all");
</script>';

but i am only getting page numbers no image. can u tell me what am i doing wrong.
in short what i am asking is how to add header and footer to my pdf. i tried the code given on their site but didn't work
0
Comment
Question by:nandananushil1
1 Comment
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 33550848
Consider using FPDF, which is the industry standard.  Learn more here:
http://www.fpdf.org/

Once you have made even a little progress with FPDF, you will never even think of using anything else for PDF generation!  It's easy and fast, ~Ray
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question