problem with PDF::Report and images (uses PDF::API2)

Hi all,


I'm trying out some PDF modules and have had some success with PDF::Report
(http://search.cpan.org/author/AORR/PDF-Report-1.10/Report.pm) adding text
and primitive graphics. PD::Report is a wrapper for PDF::API2.

But I'm not having any luck inserting images. Here are the instructions:

     $pdf->addImg($file, $x, $y);

     Add image $file to the current page at position ($x, $y).

I assume that I should provide a filename here. If I do that with a jpeg
image for example, I get this error:

sputnik:~/perl/pdf -> ./new_report > report-new.pdf
Can't call method "val" on an undefined value at
/usr/lib/perl5/site_perl/5.8.0/PDF/API2/PDF/Image.pm line 43.
 
If I try this with a png image (say cpan_banner.png) the program runs
successfully, but Adobe Acrobat Reader reports an error while trying to
parse the image.

#!/usr/bin/perl
use warnings;
use strict;

use PDF::Report;

my $pdf = new PDF::Report();
$pdf->newpage();

my $file = 'image.jpg';
my $x1 = 50;
my $y1 = 450;

$pdf->addImg($file, $x1, $y1, $scale);
### Same problem with 'addImgScaled'

# generate output stream
print $pdf->Finish();

__END__

If I try with a gif, I get:
sputnik:~/perl/pdf -> ./new_report > report-new.pdf
image 'balloon.gif' has unknown format with signature '474946383961' at
/usr/lib/perl5/site_perl/5.8.0/PDF/API2/Image.pm line 75.


I've looked at the various modules (Gfx.pm, Image.pm) but see nothing that I
can puzzle out.


-- 
Kevin Pfeiffer
International University Bremen


0
pfeiffer
9/7/2003 9:39:43 AM
perl.beginners 29384 articles. 4 followers. Follow

0 Replies
864 Views

Similar Articles

[PageSpeed] 51

Reply:

Similar Artilces:

data truncation problem while Exporting report to PDF using Crystal Reports 11.0
hi, I need a solution for data truncation problem while Exporting report to PDF using Crystal Reports 11.0 version.    ...

Show Image in PDF using Reporting Services
Hi, I am generating PDF file using Reporting service 2005. In the PDF file, I want to display an image dynamically. The image folder is  stored in a server. So, In the .rld report designer, is there any way that I can set the URL of the  image control dynamically? Regards, Syed. You should be able to do this by using the report's code property & writing some VB to determine what image to display....

How to generate PDF report from datagrid using Gios PDF .NET or itextsharp library ?
I have a problem.I am developing my web application using csharp on visual studio 2003. I am able to generate datagrid without any problem. But I want records on datagrid to be exported on pdf document. Have tried using Gios PDF .NET library, from http://www.codeproject.com/KB/graphics/giospdfnetlibrary.aspx. But the problem I have is when declare in my code using Gios PDF. it is saying that it does not know about Gios PDF. I have tried to put references but not working. How can I do it? So that I use this powerful library. The problem I have is calling the Gios PDF .NET library in my files....

how to convert dynamicaly loading images to pdf using HTML to PDF Converter for .NET
how to convert dynamicaly loading images to pdf using HTML to PDF Converter for .NET Now am converting using how to convert dynamicaly loading images to pdf using HTML to PDF Converter for .NET  tool. But the dynamicaly loading images are not showing in the pdf .     Are you using 3rd party tool or you are using iTextSharp free utility? If it is 3rd party tool, it's always suggested to ask the company which built the tool. Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti Hi vishnusekhar, As to convert images/douments ...

PDF::API2 module example for edit pdf and save new pdf file
Dear sirs, I want to learn more about open pdf file and edit and save some other new pdf file. I use PDF::API2 module, Kindly give me an example... Thanking you Regards Baskaran NK baskaran wrote: > Dear sirs, > > I want to learn more about open pdf file and edit and save some other new > pdf file. > I use PDF::API2 module, Kindly give me an example... > > Thanking you > > Regards > Baskaran NK > > > http://search.cpan.org/src/AREIBENS/PDF-API2-0.41/examples/ http://danconia.org ...

Problem with image-column and PDF with JPG images
We are using Sybase ASE 12.0.0.7 on Win NT. (Adaptive Server Enterprise/12.0.0.7/P/EBF 11096 ESD 1/NT (IX86)/OS 4.0/2008/32bit/OPT/Wed May 07 01:29:40 2003) and are using jconnect to store PDF files in an image-column: create table blobstore ( blobid INT not null, document image null, lastsaved datetime null, primary key (blobid) ) ; We are having no problems with storing and retrieving PDF files WITHOUT embedded JPG images. But when we include JPG images in the PDF file, the retrieved PDF file from the database has been corrupted. The f...

PDF Generation with PDF::API2 or similar
Dear Gurus, What is the preferred way to generate PDF file? I have never done this before and PDF::API2 seems to look good on cpan, but I can't find any tutorials. Anyone got any tips? -- Just getting into the best language ever... Fancy a yourname@perl.me.uk? Just ask!!! Gavin Henry wrote: > Dear Gurus, > > What is the preferred way to generate PDF file? > > I have never done this before and PDF::API2 seems to look good on cpan, > but I can't find any tutorials. > > Anyone got any tips? > > There was a good discussion...

Exporting Report in PDF with TextBoxes in PDF
 Hi Friends,Currently  i am working on 1 report which have 22 pages(22 page design ).And client requirement is that he must need this report exported in PDF  with textboxes in PDF.Can any one please know me how i can export my report in PDF with textboxes in PDF?Client don't want this report in word or other Format, He must require only in PDF. Thanks in advance. With Regards,Mayank PrajapatiMCP, MCTS .Net 2.0If this is a correct answer then please mark this as answer....

Writing to a PDF file or using PDF in RDLC using VWD 2005 Express
I've looked all over this forum to know how to write to a PDF file without any success. What I want to do is have the user press a button or click a link and a form/application will print out with the fields filled in from the SQL Server Express database. The form/application is a PDF file (some have edit fields some don't). I need a way to fill in this form/application using data from the database already. I've looked at some third party packages without understanding how they work. I've tried to place the PDF file on the rdlc form (or convert it) so it generates like a report witho...

Problem in open PDF file and extract PDF
 Hi,My problem is I need to open a PDF file (10 Pages) in new window when the user clicks a button from the parent form. User can enter no of pages to extract from PDF (For Example 1-4). then I have to extract 1st 4 pages from that PDF and the PDF window should show only 6 pages because we have extracted 1st 4 pages. I mean we have to refresh the PDF window.Is there any way to do that in ASP.net? If I am not clear about this issue please let me know that. Thanks in advance. to view the pdf file in another page :   Response.ClearContent() ...

Problem with PDF web links embedded in PDF
My firm recently ran an online survey, and the survey allowed users to attach documentation of their answers after answering questions. The completed test arrives as a PDF, and the embedded documentation is also a PDF, but is accessed via a link within the master PDF. But those links to the PDFs won't open when Firefox is my default browser: I have to make IE the default. Otherwise, it just tells me that Acrobat Reader can't open the document within the browser. I've tried changing all the Firefox PDF and Adobe settings to refer PDF documents to Acrobat 8 (which ...

PDF Creation using Gios PDF Library
I found the following link http://www.codeproject.com/cs/library/giospdfnetlibrary.asp but I have absolutely no idea what to do with it.  I have downloaded the source file but there isn't any documnetation on how to use this.  Has anyone implimented this?  I am very new to ASP.NET and I'm using Visual Studio 2005.Please provide any examples in C#Thanks in advance,Steamaway To clarify I have an Invoice Print page that I want to create a PDF out of. Please provide any examples in C#Thanks in advance,Steamaway Just in case someone is looking for a solutoin I found a...

Converting a doc to pdf using (or not) a pdf pritner
I need to add the doc to pdf feature in my application. I mostly have doc or rtf files, I just want to convert them to pdf to use them as e-mail attachments. by searching "vcl doc to pdf" or "delphi doc to pdf" on google is a nightmare: just ads-websites. So I am trying another way. By assuming the user installs a pdf printer (like the free winpdf writer) I ask him to set the desired pritner for printing pdfs. So I tried with procedure PrintDocument(const documentToPrint : string) ; var printCommand : string; printerInfo : string; Device, Driver, Port:...

How to Export Large Images to PDF using iTextSharper without Resizing the Image
Hi all,I am trying to export image to PDF file using iTextSharp dll.I created a PDF file(test.pdf) and added image to that pdf file. But the problem is when the image is too large ,its not showing the complete image in pdf file.when the image height is large, i am automatically getting the vertical scroll bar in pdf file. but for width i am not getting any horizontal scroll bar.Please suggest me how to export large images to pdf file without resizing the image. I s there any way to get the horizontal and vertical scroll for PDF file.Thanks in advanceCheers,sekhar...

Web resources about - problem with PDF::Report and images (uses PDF::API2) - perl.beginners

Resources last updated: 1/17/2016 6:51:39 PM