Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
PDF::Create is no longer supported? That's too bad, I recently used it for a project and it worked well. I even added some commands myself, to support color.

Anyway: PDF is based on Postscript. In PostScript, the string delimiters are parens. That's the cause of the problems, and why it doesn't break with brackets and braces. The way around it, is to escape the parens, any parens, if PDF supports it, with a backslash. The backslash itself must be special, too.

Let me pull in the PDF docs, from PDFReference.pdf:

3.2.3 String objects — literal strings
Any characters may appear in a string except unbalanced parentheses and the backslash,which must be treated specially. Balanced pairs of parentheses within a string require no special treatment.
The "special treatment" is pretty much as in Perl: preceding each special non-word character with a backslash; newline can be represented by "\n" and a tab with "\t". No surprise there. And finally, you can use octal representation with 3 digits, again, just like in Perl: "\ddd".

That should be enough to get you on your way, I suppose. You can check the table at page 30 from the above PDF file (warning: huge file: 9MB), that is the 50th page in the document.

p.s. It seems that quite a few people are rather fond of this module, including myself. If the original author is no longer interested in supporting it, perhaps somebody else should pick it up. How does one go about, in order to do that? (BTW the best place to escape the backslashes and the parens, would be in the module.)


In reply to Re: How do I replace certain character if condition exists by bart
in thread How do I replace certain character if condition exists by peppiv

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-19 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found