Perl tutorials in pdf format




















Not quite as straight-forward, but it is another option. Glad you found the tutorial. There's a guy Jay Hannah, who's currently turning the text block into a module for CPAN that does exactly what you want: bold, italic, etc. If you check the mailing list, you'll see his posts at the top. Yeah, tough to answer without knowing exactly what your constraints are. If pure-Perl is not a necessity, I'd be inclined towards DocBook.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. What is the best Perl module to use for creating a. Ask Question. Asked 12 years, 11 months ago. Active 4 years, 8 months ago. Viewed 22k times. Unless you see another update here, this is the solution that ended up working for me.

Improve this question. Marcus Marcus 5, 7 7 gold badges 34 34 silver badges 59 59 bronze badges. Well done for posting followup and tutorial link. Add a comment. Active Oldest Votes. Among commercial libraries, I've had good experiences with pdflib. Improve this answer. Chris Dolan Chris Dolan 8, 2 2 gold badges 31 31 silver badges 72 72 bronze badges. The documentation is atrocious. I suspect, though, that once you get to grips with it, you no longer remember how frustrating it was to get to grips with it, and so nobody ever does anything about the documentation.

Alfredo no longer maintains the module.. RickMeasham: I didn't know that -- I'm further out of date than I realized If you do take over and have specific questions, please feel welcome to email me. ChrisDolan: So can anybody point out this encryption support?

I grepped the source code 'till I was blue in the face, and I don't see any other than a boolean function to tell whether the open PDF is encrypted or not. That's really strange. It's been so long that I don't recall how I came to that conclusion. Perhaps Fredo started building the encrypt code but never finished?? I really can't say Show 3 more comments. Three modules for creating PDF come to mind in no particular order Hope that helps.

AndyG 37k 8 8 gold badges 99 99 silver badges bronze badges. Glen Solsberry Glen Solsberry As a plus, you will produce beautifully typeset documents. I have used this method to create fairly complicated documents. In fact, you can create bits and pieces of the PDF in various applications and combine their output using search. G'day Marcus, Glad you found the tutorial. Suppose that you have a file customer. Now you can write a short program to add the date and the names and addresses of your customers to the letter.

Set the font size with prFontSize. The default font is Helvetica, with 12 pixel size. The rest of the code is a simple loop over the file containing the customer data to filling the template with prText.

If you know low-level PDF instructions, you can add them with with the prAdd string subroutine. Working with PDF files becomes comfortable if the document has bookmarks with a table of contents-like structure. The command-line application will interact with this package instead of directly working on PDF::Reuse. The following diagram shows the relationship between the Packages, example, and applications.

The application app-combine-console-pdfs. This is the standard package for this task. Here it parses the input filenames and the page ranges into two arrays of same length. The user also has to supply a filename for the output and, optionally, a bookmarks file. If the user passes an insufficient number of arguments, invalid filenames, or incorrect page ranges, the code invokes the the usage subroutine. It also gets invoked if the user asks explicitly for -help on the command line.

Any good command line application should be written that way. It can store these arguments as arrays infile, pages , hashes, or scalars. It also supports type checking. The application itself mainly performs error checking. If everything is fine, it calls the CombinePDFs::createPDF subroutine, passing the array of input files, the array of page ranges, and the bookmarks information.

The bookmarks scalar is optional. Page ranges can be comma-separated ranges ,14, , single pages, or the all token. You can include the same page several times in the same document.

Although PDF , by Antonio Rosella, also provides such a method, this package was not developed with the use strict pragma and gives a lot of warnings. Furthermore, the package is not actively maintained, so there seems to be no chance to fix this in the near future.

Please note that PDF::Reuse is not an object oriented package. Therefore the CombinePDFs package is not object oriented, either. A user of this package could create several instances, but all instances work on the same PDF file. Submitting complex data structures via the command line is a difficult issue, so I decided that bookmarks should come from a text file. This file has a simple markup to reflect a tree structure, where each line resembles:.

The level starts with 0 for root bookmarks. Children of the root bookmarks have a level of 1, their children a level of 2, and so on. Currently, the system supports bookmarks up to three levels of nesting:. Bookmarks are an array of hashes. Here it is the page number to open. During the loop over the file content, the code searches for each level the last entry in a variable and pushes its related children on those last entries.

The root bookmarks get collected as an array, and the loop adds the children as a reference to an array, and so on for the grand children. All of this means that you can use a bookmarks file with the PDF file with a command line like:.

In order to enable this feature until a new release will appear I included a modified version of PDF::Reuse in the examples zip file that accompanies this article. Furthermore, the bookmarks use JavaScript functions. To do that, replace the act key with a page key using the appropiate page number and scroll options:. Because I put a layer between the PDF::Reuse package and the command line application with the CombinePDFs package, it was easy to reuse those parts in the Tk-application app-combine-tk-pdfs.



0コメント

  • 1000 / 1000