Howdy!

Hokay...I have a potential use case for myself, but first, a comment:

I don't want to have to write XML.

I have a structured document that I produce. Presently, I use a C program I inherited with the job that produces custom PostScript. Unfortunately, the full document has some front and back matter (including a table of contents) that have to be generated by hand and merged together.

The Preview tool in MacOS X will convert my PostScript into PDF and leave me with a PDF with searchable and selectable text. What I'd like to be able to do (and did some preliminary poking around toward) is to directly generate a PDF, ideally with a real ToC that links to the appropriate places.

The current C program treats the body of the document as having a nested structure of bits as it sets the type. The bits of stuff are:

I'm doing this off the top of my head, so I may have left out a level of detail here. Words are the smallest unit of stuff to set, being nominally indivisible strings.

The input data gets grouped into Section chunks. When a Section is fully populated with the text and its formatting, the Section is poured into the Column, leaving a rump Section when it doesn't all fit. Keep pouring into Columns as necessary. When a Page fills up, the PostScript gets generated and sent to the output filehandle. Sections that break across a Column have a continuation header on subsequent columns, and Pages have headers in the manner of dictionaries.

Typeface stuff is applied at the Word level. Each level includes positioning data that is relative to its container, and the higher-level elements have margins and sizes (being nested rectangles).

I have a multi-tiered template in mind -- and I suspect that it could be expressed in CSS terms as well, just to confuse matters. At one point, I had worked up an XML-ish representation of the document but didn't go far with it before my attention span ran out.

yours,
Michael

In reply to Re: PDF::Template redesign - I want your ideas! by herveus
in thread PDF::Template redesign - I want your ideas! by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.