Forum: Ruby on Rails [Pdf::Witer]

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ed5307c79ba5b415b1ddfee48319099b?d=identicon&s=25 Ioana Kanda (Guest)
on 2006-06-01 13:49
(Received via mailing list)
Is anyone using Pdf::Writer?
I don know how to insert html tags in a pdf using Pdf::Writer, except
<b>
and <i>
I think an idea is with Pdf::TechBook but i hadn't seen any example till
now.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-06-01 16:42
(Received via mailing list)
On 6/1/06, Ioana Kanda <kaio4000@gmail.com> wrote:
> Is anyone using Pdf::Writer?
> I don know how to insert html tags in a pdf using Pdf::Writer, except <b>
> and <i>
> I think an idea is with Pdf::TechBook but i hadn't seen any example till
> now.

I'm not sure what you're asking for.

PDF::Writer does not (and will *never* directly) support HTML. It
supports a couple of HTML-like tags (<b> and <i> as you've noted) and
a series of stand-alone replacement (<r:.../>), stand-alone markup
(<C:.../>), and paired markup (<c:...>...</c:...>) tags that are user
definable. Adding new markup tags is well-defined (although there are
some issues with some advanced tags that are being investigated).

-austin
Ed5307c79ba5b415b1ddfee48319099b?d=identicon&s=25 Ioana Kanda (Guest)
on 2006-06-02 10:31
(Received via mailing list)
Hi Austin
Sorry for this list, but I gotta put my issues:
1. For example how do I put a background color to a text?
2. How can I go to a next line?
3. How can I make a text heading1?
Not regarding html:
4. Can I specify column width when I split my page in 2columns? With
"start_columns 2"
5. What option do I have to verify if the content that I want to put
exceeds
one page and needs a second one?
6. Can I specify a header and a footer of a page?
7. If I write smth like: "      pdf.image 'myimage.png' , :border =>
true
    "....the border isn't well positioned on the image.
Thanks in advance
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-06-02 14:07
(Received via mailing list)
On 6/2/06, Ioana Kanda <kaio4000@gmail.com> wrote:
> Sorry for this list, but I gotta put my issues:
> 1. For example how do I put a background color to a text?

There is currently no automated way to do this. It could probably be
adapted from the c:uline tag, but it might have issues because PDF
draws things in the order that they are read, and and underline can't
be drawn until the text is fully drawn. I have other issues that I am
working on and do not expect to be able to help figure this out for a
couple of months.

> 2. How can I go to a next line?

The presence of a newline in text should force a newline. I haven't
tried in a while.

> 3. How can I make a text heading1?

There's no such concept in PDF or PDF::Writer. You have to figure out
how you want to do so and probably make a method that forces font face
and size to that each time. There are probably three different places
that example code for this can be found. Look at QuickRef because it
implements an "h1" method.

> Not regarding html:
>  4. Can I specify column width when I split my page in 2columns? With
> "start_columns 2"

Um. You can specify the size of the gutter between columns.

> 5. What option do I have to verify if the content that I want to put exceeds
> one page and needs a second one?

PDF::Writer will automatically wrap to a second page. There is
(currently, and likely "forever") no way to tell this without actually
writing the text to a page.

> 6. Can I specify a header and a footer of a page?

Yes, but the concepts aren't integral to PDF::Writer. There's an
example of a header and a footer both in the code that is executed as
part of the manual.

> 7. If I write smth like: "      pdf.image 'myimage.png' , :border => true
>  "....the border isn't well positioned on the image.
> Thanks in advance

That would be a bug report, and belongs on the RubyForge site.
Otherwise, I'll lose it.

-austin
6d57db44c5a4e0721cc7f78cf0ce308a?d=identicon&s=25 Stephen Bartholomew (steveb)
on 2006-06-02 14:07
Have you seen: http://www.artima.com/rubycs/articles/pdf_writer.html ?
I'm not sure if i answers all your questions but it looks like a good
place to start.

Steve


Ioana Kanda wrote:
> Hi Austin
> Sorry for this list, but I gotta put my issues:
> 1. For example how do I put a background color to a text?
> 2. How can I go to a next line?
> 3. How can I make a text heading1?
> Not regarding html:
> 4. Can I specify column width when I split my page in 2columns? With
> "start_columns 2"
> 5. What option do I have to verify if the content that I want to put
> exceeds
> one page and needs a second one?
> 6. Can I specify a header and a footer of a page?
> 7. If I write smth like: "      pdf.image 'myimage.png' , :border =>
> true
>     "....the border isn't well positioned on the image.
> Thanks in advance
Ed5307c79ba5b415b1ddfee48319099b?d=identicon&s=25 Ioana Kanda (Guest)
on 2006-06-02 14:41
(Received via mailing list)
Thanx Stephen
I already seen it...guess I'm too dull to figure out how to add a
background
to a text. Or to make a border to a text.
Ed5307c79ba5b415b1ddfee48319099b?d=identicon&s=25 Ioana Kanda (Guest)
on 2006-06-02 16:28
(Received via mailing list)
Thanks Austin
I'm so tired that till now I haven't notice your reply.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-06-02 16:53
(Received via mailing list)
On 6/2/06, Ioana Kanda <kaio4000@gmail.com> wrote:
> > Not regarding html:
> >  4. Can I specify column width when I split my page in 2columns? With
> > "start_columns 2"
> Um. You can specify the size of the gutter between columns.

Sorry; this is incomplete. You can *also* cheat a little by mucking
around with the margins. In the future, I will probably make it
possible to specify columns a little more flexibly.

-austin
Aab7643fde6e4efd0177c5ab014928b0?d=identicon&s=25 gil (Guest)
on 2007-01-27 23:15
Do you know how to add subscript and superscrit to the pdf generated by
rails??
Re:
Fd5b8048d157a919043272d6292cb2b1?d=identicon&s=25 alex (Guest)
on 2007-02-01 12:15
(Received via mailing list)
Try posting your question on refwell.com I got my answer there quite
quickly
Cheers
This topic is locked and can not be replied to.