Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Perl module to convert pod file to pdf file

by Anonymous Monk
on Nov 28, 2003 at 11:19 UTC ( #310697=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Does there exists perl module which converts pod files to pdf files . How can I convert pdf to html. No one has given a satisfactory answer yet . Do I have to read the pdf file and decrypt it and then put it in html form . How can i achieve it . Thankyou !
  • Comment on Perl module to convert pod file to pdf file

Replies are listed 'Best First'.
Re: Perl module to convert pod file to pdf file
by Corion (Pope) on Nov 28, 2003 at 11:40 UTC

    Your (lack of) formatting makes your questions really hard to read. I draw three questions out of your posting:

    1. Is there a Perl module that converts pod files to the PDF format?
    2. How can I convert PDF files to files in HTML format?
    3. If I want to convert PDF files into the HTML format, do I have to read the PDF file and decrypt the PDF file and then put it into HTML format?
    It is customary to end questions with a question mark "?", that makes it easier for the readers to find out questions in your postings.

    Now for some answers to your questions:

    1. Looking on for pod pdf, I find Pod::Pdf, which is old but claims to create PDF output from Pod. Another approach would be to use Pod::Simple to extract valuable information from files containing Pod formatting and using one of the Pdf generating modules to create PDF format files from that.
    2. The question was answered in another node. You don't tell in which way the provided solutions were not satisfactory, and it is customary to post follow up questions or clarifications in the original thread instead of creating new threads without linking back.
    3. As detailed previously, yes, you will have to decode the PDF and then output it into HTML format, as the HTML format has no provisions for directly embedding PDF format files within HTML format files. The use of the word "decrypt" is misleading here, as PDF format files are more or less PostScript format files, which is a programming language, so I would rather use "decode" or "interpret" instead of "decrypt". The word "decrypt" hints more at encryption, which is also possible for PDF files, but not central to the problem. The words "decode" or "interpret" hint more at the nature of PDF files, namely, that they are actually programs in a specialized page description language.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
      Hi, I want to know one more thing . How can I convert .pdf file to pod file . I want to convert .pdf to pod file . Is it possible using a perl module ??? Thankyou !

        Your questions show a total lack of understanding of the differences between the several file formats you are searching information on.

        POD is the text-format in which Perl Documentation is specified, more or less in inline style, mixed with Perl code. POD does not contain font information or page layout information, nor does it have a native capability to embed graphics, be they line drawings or bitmaps. POD does also not contain any colour information. It is possible to embed formatting information for POD converters using the =for POD directive, but that won't help you if you are trying to convert generic PDF to POD. For more information on POD, see the perlpod page, also available with Perl via perldoc perlpod.

        PDF is a file format that combines programs in PostScript together with font files and graphic files into one stream, most commonly saved as a .pdf file. PostScript is a programming language created by Adobe that is specially geared to describe and output pages on printers. It still is a full programming language with loops, a stack and other complicating matters. PDF files can contain mixed content of ASCII text and binary data for the images, and also can be compressed.

        As you see, PDF and Pod have different focus, and while all Pod can relatively easy be converted into the PDF format, it is not at all easy to convert arbitrary PDF into Pod format.

        Another note on your style, it is not considered good form here to post the same question in quick succession - this will mostly serve to annoy users and not give you more quality in the answers.

        perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Perl module to convert pod file to pdf file
by Joost (Canon) on Nov 28, 2003 at 11:34 UTC
    1. Yes.
    2. Would you not rather use Pod::Html or are you asking 2 unrelated questions?
    3. I don't know if you have to, please be a little more discriptive in your questions.
    4. How can you achieve what?
    Please also see How (Not) To Ask A Question


    -- #!/usr/bin/perl -w use strict;$;= ";Jtunsitr pa;ngo;t1h\$e;r. )p.e(r;ls ;h;a;c.k^e;rs ";$_=$;;do{$..=chop}while(chop);$_=$;;eval$.;
      Hi, I am sorry for posting so many request on html converters . However , can I convert pdf to pod using a perl module ?. Is there any module for decoding the postscript ?. Thankyou !
        1. I would think not - at least not in the general case - Pod is a much simpler format than PDF. Regular pod cannot contain images for instance.
        2. Maybe, you should try
        -- #!/usr/bin/perl -w use strict;$;= ";Jtunsitr pa;ngo;t1h\$e;r. )p.e(r;ls ;h;a;c.k^e;rs ";$_=$;;do{$..=chop}while(chop);$_=$;;eval$.;
Re: Perl module to convert pod file to pdf file
by chanio (Priest) on Nov 28, 2003 at 14:56 UTC
    If what you need is a tool for doing pdf conversions (nowadays there are plenty), try GhostView. If you can't find what you are looking for there, then don't look any further.

    There is a pod2html converter that comes with the ActivePerl distribution, you should read the perldocs (perldoc pod2html).

    Pod files come practically from the comments that the programmers add to their code. So, if you would just generate a text pod-like file, why not copying and pasting from the pdf document (for example, read with Accrobat?). You could always print to a text file.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://310697]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2016-08-30 20:23 GMT
Find Nodes?
    Voting Booth?
    The best thing I ever won in a lottery was:

    Results (422 votes). Check out past polls.