Multi-page TIFF's --> PDF files

PERL

    Next

  • 1. looking for info on Net::XMPP aka Net::Jabber
    I've tried Googling but just can't find a mailing list or IRC channel where I can ask questions about writing a simple 'bot in Perl. Can anyone here help? Thanks!
  • 2. Erroring Out When Creating A Hung Process
    There's a process that I open in a script using the following code: my $cmd = "myproc -l |"; open(MYPROC, $cmd) or croak("Error $?: Couldn't execute $cmd: $!"); my @lines = <MYPROC>; close(MYPROC); This code works pretty well *unless* the process hangs, which is does occasionally. If myproc hangs, then my script hangs. Is there a way to open a process and raise an error if it runs for more than, say 15 seconds? Thanks in advance for any help! Tom Purl
  • 3. parametrical substitution in perl
    I want to write a subroutine which performs string substitution parametrically, as follows: sub doit() { my ($in,$before,$after)=@_; my $out; $out = $in; $out =~ s/$before/$after/e; return $out; } In general this works fine, but if I try and use captured buffers, it doesn't work. For example, I want to do the following: s/^(...)/$1 / i.e. insert a blank after the first three chars. if I do: &doit("ABCDEF","^(...)",'$1 '); I get back "$1 DEF" Does anyone know how to make this work???
  • 4. Hex strings treated differently when read from STDIN?
    Hi, Just curious if anyone knows why the following happens: Example 1: $ perl -e 'print("\x{4A}\x{65}\x{66}\x{66}","\n");' Jeff Example 2: $ echo '\x{4A}\x{65}\x{66}\x{66}' | perl -e 'while(<STDIN>){print("$_");}' \x{4A}\x{65}\x{66}\x{66} Example 3: $ echo '\x{4A}\x{65}\x{66}\x{66}' | perl -e 'while(<STDIN>){$line="$_"; chomp($line); @chars=split(//,"$line"); foreach $ch (@chars){print($ch,"|");}}' \|x|{|4|A|}|\|x|{|6|5|}|\|x|{|6|6|}|\|x|{|6|6|}| Not sure why Perl doesn't recognize the string in Ex. 2 as a hex string. Anyone know why? Also, how would one iterate over the individual chars of the hex string in Ex. 3? I'm assuming the answer to #2 has something to do with #3. I'm using RedHat Linux 7.2, perl 5.8.1. Thanks for any assistance you can offer! - Jeff

Multi-page TIFF's --> PDF files

Postby Rick Nakroshis » Mon, 10 Nov 2003 10:06:52 GMT

After some wrestling with the PDF::API2 module, I've gotten it to 
faithfully create PDF files from text, which if the first half of my 
project.

Multi-page TIFF's are driving me crazy, however.  The module is only 
picking up one of the pages from the TIFF.  At first I thought it was a 
flaw of the module, but have discovered that many graphics programs have 
this flaw, too.  The latest version of Irfanview, for example, only "sees" 
the first page.

Anyone have any suggestions on this?

Thanks,

Rick

Re: Multi-page TIFF's --> PDF files

Postby Ben Morrow » Mon, 10 Nov 2003 10:50:34 GMT




Use tiffsplit, which comes with libtiff.

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] *  XXXX@XXXXX.COM 

Similar Threads:

1.Image::Info::TIFF - multi-page tiff images page count

How can I get a page count of a multi-page .tif image.

I browsed in CPAN, but I can't find the TIFF.pm.

Is there any way to get the page count in perl?

If not, what is the easiest way to do it using C, etc.?

Could someone give me the easiest steps to do it as I am quite
new to perl and programming?

Just a side question:
Is tiff the only format that supports multi-page images,
or are there any other and if any, what are those?

Thank you.

2.How can I create a PDF page with only Images (EPS & TIFF)

Hello Group,

I have lot of EPS and TIFF images that needs to be manually verified.
So I wanted to create a PDF with those images.

I appreciate any help in this regard.

Regards
Dominic

System: Windows 2000
Packages available: Perl 5.8, Image magick and Ghost Script.

3.Tk::TIFF unable to recognize valid TIFF file (follow up)

-format => 'tif'
image file format "tif" is not supported at C:/Perl58/site/lib/Tk/Image.pm
line 21.

no -format option
couldn't recognize data in image file "?" at
C:/Perl58/site/lib/Tk/Image.pm line 21.

----- Original Message ----- 
From: "Tim Harsch" < XXXX@XXXXX.COM >
To: "Steve Lidie" < XXXX@XXXXX.COM >
Cc: "PTK" < XXXX@XXXXX.COM >; "Slaven Rezic" < XXXX@XXXXX.COM >
Sent: Thursday, October 09, 2003 11:31 AM
Subject: Re: Tk::TIFF unable to recognize valid TIFF file


> Hi Steve,
>     Thanks for the suggestions.  I'll give them a try and post results.
>
> This mostly black image, is part of the upper-left corner of 400X
magnified
> slide.  It's not till you work your way more to the center that you see
some
> tissue cores where gene expression experiments are.  Although I haven't
> tried all 190 photos that make up the total image, I have spot checked
ones
> throughout and they have the same issue.
>
> The one thing I should clarify is that this same line of code works for
> other Tiff's coming from the same source that generates them ( a scanning
> microscope that uses a digital camera to take pictures ).  So, I suspect
the
> source of this problem is with the Tk::Tiff module itself.  But I'll keep
> digging for more info.
>
> ----- Original Message ----- 
> From: "Steve Lidie" < XXXX@XXXXX.COM >
> To: "Tim Harsch" < XXXX@XXXXX.COM >
> Cc: "PTK" < XXXX@XXXXX.COM >; "Slaven Rezic" < XXXX@XXXXX.COM >
> Sent: Wednesday, October 08, 2003 5:44 PM
> Subject: Re: Tk::TIFF unable to recognize valid TIFF file
>
>
>
> On Wednesday, October 8, 2003, at 02:38 PM, Tim Harsch wrote:
>
> > Hi all,
> >     I'm having a problem with Tk::Tiff, for some reason I get this
> > error:
> > couldn't recognize data in image file ""?" at
> > C:/Perl58/site/lib/Tk/Image.pm line 21.
> >
> > when trying to read what appears to be a valid tiff.  I've placed the
> > tiff
> > (and the code below) on my FTP server at:
> > ftp://est.llnl.gov/pub/ch19/perltk/bad_images.zip
>
> Well, what the heck does the TIFF show?  All I get on my TIFF-ready Mac
> is mostly black.  If I were led to believe it was a deep-space picture
> in the visible spectrum I'd say, yes, there were two neutron stars and
> a red-dwarf.
>
> >
> > so as not to flood our ancient list server (or your mailboxes :-)
> >
> >     I've verified that the Tif is readable via Image Magick, Adobe
> > Photoshop
> > 2.0 and the Windows OS previewer.  This particular image is primarily
> > black
> > (it is supposed to be, although I have over 190 other example images
> > that
> > have the same problem, not all are just black).  I also, converted the
> > file
> > out using ImageMagick to a Tif copy, which also will not load.  The
> > ImageMagick copy does differ on a binary level from the original, how
> > I'm
> > not sure.  But, the copy is also viewable via Photoshop and Windows.
>
> OK, mostly black, agreed (;
>
> >
> >     The fact that ImageMagick does work with the file and Tk::Tiff
> > does not
> > is a clue I think.  Because, they both use the same libtiff DLL.  Which
> > leads me to believe the problem might be in the Tk::Tiff or Tk::Image
> > module
> > code themselves.
> >
> >     Any ideas?
>
> Lacking a Tk:TIFF module in my Jaguar-moving-to-Panther environment, I
> can only guess, but ...
>
>
> > ##############################################
> > use Tk;
> > use Tk::TIFF;
> >
> > my $mw = Tk::MainWindow->new();
> > my $fname = q/IMAGE002.Tif/;
> > my $p = $mw->Photo(-file => $fname, -format => 'tiff');
> >
>
>
> ... MPTK, p. 428 implies that -format is not be required for TIFF
> files. If so, try removing it.  Perhaps -format in this case should be
> "tif", rather than "tiff".  Obviously this works perfectly well in
> Unix-land, I cannot verify if so in Win32-land.
>
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing list
> server.  If you wish to unsubscribe from this mailing list, send the
> message body of "unsubscribe ptk" to  XXXX@XXXXX.COM 

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to  XXXX@XXXXX.COM 

4.Tk::TIFF unable to recognize valid TIFF file

Hi all,
    I'm having a problem with Tk::Tiff, for some reason I get this error:
couldn't recognize data in image file ""?" at
C:/Perl58/site/lib/Tk/Image.pm line 21.

when trying to read what appears to be a valid tiff.  I've placed the tiff
(and the code below) on my FTP server at:
ftp://est.llnl.gov/pub/ch19/perltk/bad_images.zip

so as not to flood our ancient list server (or your mailboxes :-)

    I've verified that the Tif is readable via Image Magick, Adobe Photoshop
2.0 and the Windows OS previewer.  This particular image is primarily black
(it is supposed to be, although I have over 190 other example images that
have the same problem, not all are just black).  I also, converted the file
out using ImageMagick to a Tif copy, which also will not load.  The
ImageMagick copy does differ on a binary level from the original, how I'm
not sure.  But, the copy is also viewable via Photoshop and Windows.

    The fact that ImageMagick does work with the file and Tk::Tiff does not
is a clue I think.  Because, they both use the same libtiff DLL.  Which
leads me to believe the problem might be in the Tk::Tiff or Tk::Image module
code themselves.

    Any ideas?
##############################################
use Tk;
use Tk::TIFF;

my $mw = Tk::MainWindow->new();
my $fname = q/IMAGE002.Tif/;
my $p = $mw->Photo(-file => $fname, -format => 'tiff');

exit;
1; # Ancient Druid Custom

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to  XXXX@XXXXX.COM 

5.I want an perl module for conver large html page file to multi little pages

convert an extreme large HTML file to little multi-pages,
and add links to the top of the  multi-pages, such as:

this page split to n pages:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ..n............(links)
-- 
      Your fault as a Government is My failure as a Citizen.

6. Add hyperlink/bookmark to each page ---> PDF

7. Hyperlinks in a multi-page mht file

8. Hyperlink conversion: Word =>> PDF



Return to PERL

 

Who is online

Users browsing this forum: No registered users and 15 guest