Solved

dompdf image object

Posted on 2010-08-28
1
466 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 108

Accepted Solution

by:
Ray Paseur earned 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now