LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2004, 10:04 AM   #1
Finnster
LQ Newbie
 
Registered: Nov 2004
Location: Where ever you aren't.
Distribution: Fedora Core 2
Posts: 3

Rep: Reputation: 0
PDF::API2 stream problems


Hey all,

First time poster on this forum. This is also posted over at comp.lang.perl.modules. I really need some help here with my deadline looming like a very large axe over my head.

Situation: Using PDF::API2 to open a PDF created from a Microsoft Word Document and replace certain keywords in the stream with values created from already run perl scripts. What happens is that some of the values are replaced while others are not. With the ones that are replaced, all the characters stack up on one another. I Data:umped the stream and saw Tj tags in the middle of my key words. Will that keep the substitution from happening?

Qustion is: Why is this happening and how can I fix this problem? I use code that looks a lot like this:

my $letter = PDF::API2->open( 'coverletter.pdf' );
if ( !$letter ) {
$i->{'error'}->setError('Failed to load page pdf object');
return '';
}

# Blank pdf object.
my $pdf = PDF::API2->new();
if ( !$pdf) {
$i->{'error'}->setError('Failed to load page pdf object');
return '';
}
my $page = $pdf->importpage( $letter, 1, 0 );
$page->cropbox(5,5,594,774);
$page->mediabox(5,5,594,774);

# Break open the contents.
my $stream = PDF::API2::unfilter( $page->{'Contents'}->{' val'}->[0]->{'Filter'}, $page->{'Contents'}->{' val'}->[0]->{' stream'}
);
$stream =~ s/foo/$bar/g;

What am I doing wrong here?

Also, I need to put two .png chart images into the pdf document. How can I achieve this?

And lastly.. Is it more benificial to use Excel as the template to create a pdf document to keep this thing from happening?

All help is greatly appreciated.

Thank you,
Eric
 
Old 11-03-2004, 12:13 PM   #2
Finnster
LQ Newbie
 
Registered: Nov 2004
Location: Where ever you aren't.
Distribution: Fedora Core 2
Posts: 3

Original Poster
Rep: Reputation: 0
Bumped for help....

please?????
 
Old 11-03-2004, 02:07 PM   #3
Finnster
LQ Newbie
 
Registered: Nov 2004
Location: Where ever you aren't.
Distribution: Fedora Core 2
Posts: 3

Original Poster
Rep: Reputation: 0
Bumping again....really need help......
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
transfere a pcl stream to pdf files hjl Linux - Software 0 11-04-2005 10:21 AM
media stream problems Ephracis Linux - Software 1 05-02-2005 12:36 PM
Cam Stream install problems (Fedora) stuzuk Linux - Software 2 02-16-2004 10:13 AM
PDF::API2 Iīdont know get to Intro. Bidea20 Programming 0 02-13-2004 02:20 AM
Pdf::api2 Bidea20 Programming 1 02-13-2004 01:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration