Hey Everyone,
I was wondering if someone could help me out. I have a Perl CGI script that needs to do the following:
[ol]
[li]Accept a PDF page number as input.[/li]
[li]Extract the page corresponding to the page number received in step 1 from a multiple-page PDF document.[/li]
[li]Convert the extracted page to a JPEG image and send it back to the browser.[/li]
[/ol]
On the surface, this initially appeared to be fairly simple. That is until I got to step 3. I used the PDF::Extract module for step 2 which made extracting a page out of a multiple-page PDF document extremely easy. However, finding a way to convert the extracted page to a JPEG image has been
challenging. I've searched CPAN fairly exhaustively for a module that could help but didn't really find anything. Basically, I was hoping I could find a module where I could do something like the following:
[blue]
[tt]
$m = SomeModule->new();
$m = SomeModule->load( $pdf_content );
$image = $SomeModule->convert_to_jpeg();
print( "Content-type: image/jpeg\n\n" );
print( $image );
[/tt]
[/blue]
However, as stated previously I didn't really find anything on CPAN. Does anyone have any suggestions on how I might go about handling step 3? Any help at all would be greatly appreciated. Thanks in advance.
Chris
I was wondering if someone could help me out. I have a Perl CGI script that needs to do the following:
[ol]
[li]Accept a PDF page number as input.[/li]
[li]Extract the page corresponding to the page number received in step 1 from a multiple-page PDF document.[/li]
[li]Convert the extracted page to a JPEG image and send it back to the browser.[/li]
[/ol]
On the surface, this initially appeared to be fairly simple. That is until I got to step 3. I used the PDF::Extract module for step 2 which made extracting a page out of a multiple-page PDF document extremely easy. However, finding a way to convert the extracted page to a JPEG image has been
challenging. I've searched CPAN fairly exhaustively for a module that could help but didn't really find anything. Basically, I was hoping I could find a module where I could do something like the following:
[blue]
[tt]
$m = SomeModule->new();
$m = SomeModule->load( $pdf_content );
$image = $SomeModule->convert_to_jpeg();
print( "Content-type: image/jpeg\n\n" );
print( $image );
[/tt]
[/blue]
However, as stated previously I didn't really find anything on CPAN. Does anyone have any suggestions on how I might go about handling step 3? Any help at all would be greatly appreciated. Thanks in advance.
Chris