Hmm, I'm not quite sure I understand. Are you asking whether you can
put literal ASCII escape characters (like \t) in the text of your
Prawn document? If so, that's probably not possible, depending on
exactly what it is you're trying to accomplish. PDF is more low-level
than that; the things that get drawn to the page are closer to glyphs,
not characters. (Think of PDF as a way of describing where the ink is
on the page, not what the document "means" or "is".)
Now you could possibly use a Unicode cmap to indicate that a
particular character maps to a tab. (The Unicode character map is the
feature that PDF uses to bridge the aforementioned gap between ink on
a page and actual characters, e.g., for a program that wants to
extract text from a PDF. It indicates the mapping between characters
from a font subset and Unicode code points.) But I'm not sure whether
that would have any relevance to the problem you're actually trying to
solve.
Can you go into a bit more detail about what you're trying to do so we
can see if it's feasible?
-be
Are you asking whether you canput literal ASCII escape characters (like \t) in the text of your
Prawn document? ...
... possibly use a Unicode cmap to indicate that a
particular character maps to a tab....
Can you go into a bit more detail ...
First, let me say... cool! As a Prawn developer, I love hearing about
interesting uses of Prawn in the wild. And as the owner of a software
consultancy, I also love hearing about systems like this regardless!
> Some of the courts want to enter standard fields such as Plaintiff using QR
> codes. Typically, the office of the Clerk of Court is not tech savvy at
> all, so it is a stretch of their ability to just plug in a barcode scanner
> and blip a half-dozen codes. Forget about embedding tagged fields or XML in
> the QR codes - writing code to parse data structures would involve an
> extremely politicized county bureaucracy of staff IT folks and endless
> meetings.
>
> So they want encoded data that matches _exactly_ their input screens:
> First-name <TAB> Middle-initial <TAB> ...
So unless I'm mistaken, it sounds like you need the tab characters
embedded in the QR codes, not in text in the PDF itself, right? How
are you generating your QR codes?
First, let me say... cool! As a Prawn developer, I love hearing about
interesting uses of Prawn in the wild. And as the owner of a software
consultancy, I also love hearing about systems like this regardless!
So unless I'm mistaken, it sounds like you need the tab characters
embedded in the QR codes, not in text in the PDF itself, right? How
are you generating your QR codes?
I hear you there. Thankfully I've been able to avoid most of this mess
personally.
>> So unless I'm mistaken, it sounds like you need the tab characters
>> embedded in the QR codes, not in text in the PDF itself, right? How
>> are you generating your QR codes?
>
> Barby, which is a prawn wrapper for the actual encoding algorithm provided
> by rqrcode.
> Both of those gems are very cleanly written: seacreature would be proud.
OK, I've used Barby and I like it. Can you provide a code snippet that
shows what you're trying to do? I think this is a Barby question, not
a Prawn one.
-be
HP is a hollowed-out shell of what it once was. It is sad.
.... can you provide a code snippet that
shows what you're trying to do? I think this is a Barby question, not
a Prawn one.
I tried embedding a tab in a QR code, and it worked fine. Here's my sample code:
https://gist.github.com/1791941
Scanning these with my mobile phone, they contained exactly the data I
requested -- the first was a five-byte string "hello", and the second
a six-byte string "hello\t". Pasting this into another application
yielded a hard tab character, just as expected.
If these aren't scanning correctly, I'm guessing it's a problem with
the barcode scanner you're using -- assuming it's a keyboard wedge,
perhaps it's not configured to pass through tab characters as tab
keypresses?
-be
I tried embedding a tab in a QR code, and it worked fine....
If these aren't scanning correctly, I'm guessing it's a problem with
the barcode scanner you're using...