[ANN] PDF::Writer 1.0 (version 1.0.1)

= PDF::Writer

At long last, I have released PDF::Writer 1.0. The released version
is 1.0.1 and is available from RubyForge:

Homepage:: http://rubyforge.org/projects/ruby-pdf/

PDF::Writer is a pure-Ruby PDF document generator. It implements
about 75% of the PDF 1.3 specification and none of the advanced
operations from PDF 1.4, 1.5, or 1.6. It does MORE than just write
raw PDF documents, though; it implements a simple text layout engine
that does the right thing most of the time.

  http://partners.adobe.com/public/developer/pdf/index_reference.html

In addition to the core functionality, there are two specialised
document creators, table generation, and a sample chart type.

The release contains several demonstration programs and the
canonical 82-page manual in PDF. On my home development machine (a
1Ghz Transmeta Crusoe with 512 Mb RAM), it takes about 5 minutes to
generate the manual; it should be faster on most machines (about 1m
30s on my work machine). This is an extremely complex document that
represents far more than is likely to be used in most production
cases. The manual can be generated from the .tar.gz or .gem release
by running the "techbook" program.

There is a mailing list listed on the RubyForge project.

== Upgrading
If you've been using PDF::Writer 0.1 (the official version of the
technology preview released in September 2003), you will have a bit
of work ahead of you: the API is dramatically different. I have had
positive reports from a few users brave enough to use the CVS
version first checked in last month for the conversion.

== Licence Notes
Copyright:: 2003—2005, Austin Ziegler

PDF::Writer is released under a MIT-style licence and can be
distributed without any restrictions but also without any warranty.
However, there are portions of the PDF::Writer distribution that are
under more restrictive licences because some items derive from work
by others. PDF::Writer is also covered by a number of patents for
which Adobe has granted nonexclusive royalty-free licences.

== Requirements
PDF::Writer requires Ruby 1.8.2 or better, color-tools 1.0.0 or
better, and Transaction::Simple 1.3.0 or better.

== Change Log
=== PDF::Writer 1.0.1
* Fixed a few minor gem issues.
* Renamed bin/manual to bin/techbook.
* Fixed the manual.pwd locator for the default install.

=== PDF::Writer 1.0.0
* Integrated ezwriter.rb functionality with writer.rb.
* Factored out some functionality into modules and classes.
* Added CMYK colour support to JPEG images.
* Uses Color::CMYK (from color-utils) to provide CMYK support to
  drawing capabilities.
* Simplified the image API significantly.
* Modified image support to properly handle full image flipping.
* Fixed several multi-column issues.
* Fixed a bug where new pages automatically started by overflowing
  text may have resulted in writing the first line of text above the
  top margin. This may need further testing and probably causes
  problems with column handling.
* Fixed some page numbering issues.
* Added several demos, including Ruby Quick Reference Sheets.
* Scrubbed the API.
* Updated the documentation.
* Changed installer to setup.rb 3.3.1-modified.
* Applied an image resize patch; the image will be resized manually
  before checking to see if a new page is required. Thanks to Leslie
  Hensley.
* Fixed a bug where entities would generate the width specified for
  the component characters, not the represented characters.
* Fixed a performance bug. Thanks again to Leslie Hensley.

== Credits
* Leslie Hensley <http://www.showerinabox.com/> has been amazing
  during the last month, finding and helping to fix a major
  performance bug. This is definitely a use of PDF::Writer that I
  hadn't forseen, but am tickled pink(!) to see people use it in
  ways that I hadn't imagined.

== Notes
* PDF::Writer won't restore your hair line, but it will certainly
  reduce the speed at which you lose your hair due to report
  generation.

···

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

There are two notes regarding this. Thanks to Bill Guindon for finding one.

1. The 1.0.1 gem does not install on Windows. You will need to use the
.tar.gz. I'm not
   sure if this is a problem with RubyGems or the Windows 1.8.2-15
installer, but there is
   a Zlib buffer error :frowning: If I can generate a workaround, I will.
2. There is a file that should not be included in either distribution
that I forgot to clean up.
   Ignore or remove the techbook.bat. I don't remember if the setup.rb
does this properly
   or not, but I will make sure that it does with the next release.

-austin

···

On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:

= PDF::Writer

At long last, I have released PDF::Writer 1.0. The released version
is 1.0.1 and is available from RubyForge:

Homepage:: http://rubyforge.org/projects/ruby-pdf/

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Austin Ziegler wrote:

At long last, I have released PDF::Writer 1.0. The released version
is 1.0.1 and is available from RubyForge:

Homepage:: http://rubyforge.org/projects/ruby-pdf/

Thanks! This looks promising! But it's hard to evaluate immediate usefulness without seeing results and API.

Any chances to get a "Project Home Page" with (at least the same info that you wrote in this email and) the complex manual as a show case and browsable API reference (and/or documentation). Now I guess I'll be able to reach it only by installing and running or generating RDoc on my own.

The release contains several demonstration programs and the
canonical 82-page manual in PDF. On my home development machine (a
1Ghz Transmeta Crusoe with 512 Mb RAM), it takes about 5 minutes to
generate the manual; it should be faster on most machines (about 1m
30s on my work machine).

At first this seemed to be quite slow, but then, if a document of some complexity takes roughly 1 sec / page it might not be that bad. Unless you've used to LaTeX but then you have used to many other problems as well :).

  - Aleksi

No love from PDF::Writer on Mac OS X 10.4.1. I hope to get this fixed
as I'm really looking forward to using this library. Thanks for all
the hard work Austin!

Installed via gem, accepted the dependencies.

legolas:~ jason$ ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

Here is the error. My wild guess would be this is an Endian-ness
issue when reading in the images, but I don't have any evidence to
back up that claim, nor do I have the knowledge to figure it out
myself. If any more info is required I will surely oblige.

legolas:~ jason$ techbook
Using default document '/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/
lib/pdf/../../manual.pwd'.

Error in document around line 205:
  /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/
graphics/imageinfo.rb:176:in `measure_JPEG': JPEG marker not found!
Backtrace:
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
690:in `techbook_directive_endeval'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/graphics/
imageinfo.rb:174:in `loop'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/graphics/
imageinfo.rb:174:in `measure_JPEG'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/graphics/
imageinfo.rb:85:in `__send__'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/graphics/
imageinfo.rb:85:in `initialize'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/
graphics.rb:546:in `new'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/
graphics.rb:546:in `add_image'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/writer/
graphics.rb:537:in `add_image_from_file'
(eval):43:in `techbook_directive_endeval'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb: 686:in `eval'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
690:in `techbook_directive_endeval'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
686:in `initialize'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb: 686:in `new'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
686:in `techbook_directive_endeval'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
547:in `__send__'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
547:in `techbook_parse'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb: 536:in `each'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
536:in `techbook_parse'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb: 874:in `run'
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/bin/techbook:24
/usr/bin/techbook:18:in `load'
/usr/bin/techbook:18
/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/techbook.rb:
690:in `techbook_directive_endeval': /usr/lib/ruby/gems/1.8/gems/pdf-
writer-1.0.1/lib/pdf/writer/graphics/imageinfo.rb:176:in
`measure_JPEG': JPEG marker not found! (RuntimeError)
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics/imageinfo.rb:174:in `loop'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics/imageinfo.rb:174:in `measure_JPEG'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics/imageinfo.rb:85:in `__send__'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics/imageinfo.rb:85:in `initialize'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics.rb:546:in `new'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics.rb:546:in `add_image'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
writer/graphics.rb:537:in `add_image_from_file'
        from (eval):43:in `techbook_directive_endeval'
         ... 9 levels...
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/
techbook.rb:874:in `run'
        from /usr/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/bin/ techbook:24
        from /usr/bin/techbook:18:in `load'
        from /usr/bin/techbook:18
Exception around line 0.

Thanks!

Jason

> = PDF::Writer
>
> At long last, I have released PDF::Writer 1.0. The released version
> is 1.0.1 and is available from RubyForge:
>
> Homepage:: http://rubyforge.org/projects/ruby-pdf/

There are two notes regarding this. Thanks to Bill Guindon for finding one.

1. The 1.0.1 gem does not install on Windows. You will need to use the
.tar.gz. I'm not
   sure if this is a problem with RubyGems or the Windows 1.8.2-15
installer, but there is
   a Zlib buffer error :frowning: If I can generate a workaround, I will.

Gem installed fine here with "gem install pdf".

C:\>ruby -v
ruby 1.8.2 (2004-07-29) [i386-mswin32]

2. There is a file that should not be included in either distribution
that I forgot to clean up.
   Ignore or remove the techbook.bat. I don't remember if the setup.rb
does this properly
   or not, but I will make sure that it does with the next release.

Only ran across that from trying to find the techbook app (which was
appropriately in ruby/bin).

... and Wow! That's one impressive library!

The manual is well done, and it also serves as a great example of how
powerful this is.

···

On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:

On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:

-austin
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

--
Bill Guindon (aka aGorilla)

Austin Ziegler wrote:

At long last, I have released PDF::Writer 1.0. The released
version is 1.0.1 and is available from RubyForge:

Homepage:: http://rubyforge.org/projects/ruby-pdf/

Thanks! This looks promising! But it's hard to evaluate immediate
usefulness without seeing results and API.

Any chances to get a "Project Home Page" with (at least the same
info that you wrote in this email and) the complex manual as a
show case and browsable API reference (and/or documentation). Now
I guess I'll be able to reach it only by installing and running or
generating RDoc on my own.

Yes. All of this *will* be made available, but it's taking a bit of
time as I do have to do this in my spare time and work is quite busy
right now (with equally interesting stuff -- XMPP!).

It may be next week before the first pass at the home page gets
posted. I'm currently evaluating a couple of different technologies
that will help me reduce the amount of duplicated information I have
to type :wink:

The release contains several demonstration programs and the
canonical 82-page manual in PDF. On my home development machine
(a 1Ghz Transmeta Crusoe with 512 Mb RAM), it takes about 5
minutes to generate the manual; it should be faster on most
machines (about 1m 30s on my work machine).

At first this seemed to be quite slow, but then, if a document of
some complexity takes roughly 1 sec / page it might not be that
bad. Unless you've used to LaTeX but then you have used to many
other problems as well :).

There are some important points to measure with this timing. First,
this is pure Ruby. There's no C code in this library, except the
Ruby interpreter. Second, the manual has at about two dozen tables,
and tables are known to be the slowest thing in the library --
because of the way that I implement the necessary backtracking
capabilities/undo buffer (as whole objects using
Transaction::Simple).

What I know is that Leslie Hensley is generating 6-page documents
relatively quickly. Whether this is a partially generated PDF (a
technique that I will be illustrating in the web pages) or fully
generated on the fly, I don't know. But it's visibly responsive for
web downloads (~3 seconds or less).

There's definitely some neat tricks, and there will be some
improvements that I will be making to the API over time. Some of
these will come a little later, as they will be breaking existing
APIs (I meant to, but forgot to, improve the image APIs to allow for
easy hyperlinked images; however, I was looking over the reference
documentation on annotations and actions and see that I need to
drastically improve *that* moving forward, too.) Others may come in
the near future as I get a few other things done (such as maybe
having an #each that iterates through the pages on the document).

-austin

···

On 6/14/05, Aleksi <foobar@fuzzball.org.net> wrote:
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

* Austin Ziegler <halostatue@gmail.com> [2005-06-14 10:17:24 +0900]:

> = PDF::Writer
>
> At long last, I have released PDF::Writer 1.0. The released version
> is 1.0.1 and is available from RubyForge:

Great. I'm excited to roll this into my app.
However, none of the demos seem to work.

irb(main):013:0> pdf.select_font("Helvetica")
TypeError: Font Helvetica not found.
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/font.rb:109:in `open'
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/writer.rb:228:in `open_font'
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/writer.rb:245:in `select_font'
from (irb):13

But, if I add a path I get:

irb(main):014:0> pdf.select_font("pdf/fonts/Helvetica")
=> "pdf/fonts/Helvetica"
irb(main):015:0> pdf.select_font("pdf/fonts/Times-Roman")
=> "pdf/fonts/Times-Roman"

Is this correct behaviour?

···

On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:

from :0

--
Jim Freeze

That seems weird. Is there anyone who can grant me access to a MacOS X
box with 10.4.1 to test this?

JPEGs are supposed to be in network byte order. Jason, the other
option is to look at the ImageSize and see if it gives a similar
result.

I want to solve this, but I don't have access to a MacOS X box. :frowning:

-austin

···

On 6/14/05, Jason Foreman <threeve.org@gmail.com> wrote:

No love from PDF::Writer on Mac OS X 10.4.1. I hope to get this fixed
as I'm really looking forward to using this library. Thanks for all
the hard work Austin!

Installed via gem, accepted the dependencies.

legolas:~ jason$ ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

Here is the error. My wild guess would be this is an Endian-ness
issue when reading in the images, but I don't have any evidence to
back up that claim, nor do I have the knowledge to figure it out
myself. If any more info is required I will surely oblige.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

This is an old version of PDF::Writer installed in your site_ruby (the
current release doesn't have pdf/font.rb; it's
pdf/writer/fontmetrics.rb). If you have an old version installed, you
*will* want to remove it before installing the new version.

A fresh install works just fine.

-austin

···

On 6/14/05, Jim Freeze <jim@freeze.org> wrote:

* Austin Ziegler <halostatue@gmail.com> [2005-06-14 10:17:24 +0900]:
> On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:
> > = PDF::Writer
> >
> > At long last, I have released PDF::Writer 1.0. The released version
> > is 1.0.1 and is available from RubyForge:
Great. I'm excited to roll this into my app.
However, none of the demos seem to work.

irb(main):013:0> pdf.select_font("Helvetica")
TypeError: Font Helvetica not found.
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/font.rb:109:in `open'
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/writer.rb:228:in `open_font'
from /Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/pdf/writer.rb:245:in `select_font'
from (irb):13
from :0

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

For what it's worth, the manual built fine on my box (10.4.1).

- Jamis

···

On Jun 14, 2005, at 5:11 PM, Austin Ziegler wrote:

On 6/14/05, Jason Foreman <threeve.org@gmail.com> wrote:

No love from PDF::Writer on Mac OS X 10.4.1. I hope to get this fixed
as I'm really looking forward to using this library. Thanks for all
the hard work Austin!

Installed via gem, accepted the dependencies.

legolas:~ jason$ ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

Here is the error. My wild guess would be this is an Endian-ness
issue when reading in the images, but I don't have any evidence to
back up that claim, nor do I have the knowledge to figure it out
myself. If any more info is required I will surely oblige.

That seems weird. Is there anyone who can grant me access to a MacOS X
box with 10.4.1 to test this?

JPEGs are supposed to be in network byte order. Jason, the other
option is to look at the ImageSize and see if it gives a similar
result.

I want to solve this, but I don't have access to a MacOS X box. :frowning:

* Austin Ziegler <halostatue@gmail.com> [2005-06-15 00:46:55 +0900]:

This is an old version of PDF::Writer installed in your site_ruby (the
current release doesn't have pdf/font.rb; it's
pdf/writer/fontmetrics.rb). If you have an old version installed, you
*will* want to remove it before installing the new version.

A fresh install works just fine.

Ah yes. It works now. Thanks.

BTW, did you really mean to 'squeeze' the Gettyburg address so that all
double letter words are now misspelled? E.g.:

  fitting => fiting
  battlefield => batlefield
  hallow => halow

···

--
Jim Freeze

Okay. The next step, I guess, would be for Jason to see about sending
me the tiny logo JPEG in his gem directory to see if I can tell
anything intelligent about it. It seems to have been corrupted during
install, somehow.

-austin

···

On 6/14/05, Jamis Buck <jamis@37signals.com> wrote:

> That seems weird. Is there anyone who can grant me access to a MacOS X
> box with 10.4.1 to test this?
>
> JPEGs are supposed to be in network byte order. Jason, the other
> option is to look at the ImageSize and see if it gives a similar
> result.
>
> I want to solve this, but I don't have access to a MacOS X box. :frowning:
For what it's worth, the manual built fine on my box (10.4.1).

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

You mean that's not the way that Abe spelled it?

No, that's a bug. :wink: If I can get a working Win32 gem, that will be
fixed in a 1.0.2 release as well.

-austin

···

On 6/14/05, Jim Freeze <jim@freeze.org> wrote:

* Austin Ziegler <halostatue@gmail.com> [2005-06-15 00:46:55 +0900]:
> This is an old version of PDF::Writer installed in your site_ruby (the
> current release doesn't have pdf/font.rb; it's
> pdf/writer/fontmetrics.rb). If you have an old version installed, you
> *will* want to remove it before installing the new version.

> A fresh install works just fine.
Ah yes. It works now. Thanks.

BTW, did you really mean to 'squeeze' the Gettyburg address so that all
double letter words are now misspelled? E.g.:

  fitting => fiting
  battlefield => batlefield
  hallow => halow

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

This is very odd. All the JPEGs open fine in an image editor, but
they don't work with PDF::Writer...

Jamis, did you compile your own version of Ruby or patch the version
that Apple distributes (I believe I used the Ruby on Rails installer
for Tiger package) ? I think compiling Ruby might be my next step.
I've had this problem on two separate machines running 10.4.1.

Austin, I can provide you access to a machine if you want, but it
sounds like this is my issue, not yours.

Thanks for the help guys.

Jason

···

On 6/14/05, Austin Ziegler <halostatue@gmail.com> wrote:

On 6/14/05, Jamis Buck <jamis@37signals.com> wrote:
> > That seems weird. Is there anyone who can grant me access to a MacOS X
> > box with 10.4.1 to test this?
> >
> > JPEGs are supposed to be in network byte order. Jason, the other
> > option is to look at the ImageSize and see if it gives a similar
> > result.
> >
> > I want to solve this, but I don't have access to a MacOS X box. :frowning:
> For what it's worth, the manual built fine on my box (10.4.1).

Okay. The next step, I guess, would be for Jason to see about sending
me the tiny logo JPEG in his gem directory to see if I can tell
anything intelligent about it. It seems to have been corrupted during
install, somehow.

FYI, I've now tried all 3 available methods of installation of
PDF::Writer, Color-Tools and Transaction::Simple: remote gem, local
gem, local tar.gz. All three methods result in the same error as
before. And I did remove the previous installs before installing a
new version.

···

On 6/14/05, Jason Foreman <threeve.org@gmail.com> wrote:

On 6/14/05, Austin Ziegler <halostatue@gmail.com> wrote:
> On 6/14/05, Jamis Buck <jamis@37signals.com> wrote:
> > > That seems weird. Is there anyone who can grant me access to a MacOS X
> > > box with 10.4.1 to test this?
> > >
> > > JPEGs are supposed to be in network byte order. Jason, the other
> > > option is to look at the ImageSize and see if it gives a similar
> > > result.
> > >
> > > I want to solve this, but I don't have access to a MacOS X box. :frowning:
> > For what it's worth, the manual built fine on my box (10.4.1).
>
> Okay. The next step, I guess, would be for Jason to see about sending
> me the tiny logo JPEG in his gem directory to see if I can tell
> anything intelligent about it. It seems to have been corrupted during
> install, somehow.
>

This is very odd. All the JPEGs open fine in an image editor, but
they don't work with PDF::Writer...

Jamis, did you compile your own version of Ruby or patch the version
that Apple distributes (I believe I used the Ruby on Rails installer
for Tiger package) ? I think compiling Ruby might be my next step.
I've had this problem on two separate machines running 10.4.1.

Austin, I can provide you access to a machine if you want, but it
sounds like this is my issue, not yours.

Thanks for the help guys.

Jason

Jason, yes, I did compile Ruby (well, used darwinports). I never even bothered using the one that came with Tiger, after hearing lots of people berate its brokenness.

- Jamis

···

On Jun 14, 2005, at 9:06 PM, Jason Foreman wrote:

On 6/14/05, Austin Ziegler <halostatue@gmail.com> wrote:

On 6/14/05, Jamis Buck <jamis@37signals.com> wrote:

That seems weird. Is there anyone who can grant me access to a MacOS X
box with 10.4.1 to test this?

JPEGs are supposed to be in network byte order. Jason, the other
option is to look at the ImageSize and see if it gives a similar
result.

I want to solve this, but I don't have access to a MacOS X box. :frowning:

For what it's worth, the manual built fine on my box (10.4.1).

Okay. The next step, I guess, would be for Jason to see about sending
me the tiny logo JPEG in his gem directory to see if I can tell
anything intelligent about it. It seems to have been corrupted during
install, somehow.

This is very odd. All the JPEGs open fine in an image editor, but
they don't work with PDF::Writer...

Jamis, did you compile your own version of Ruby or patch the version
that Apple distributes (I believe I used the Ruby on Rails installer
for Tiger package) ? I think compiling Ruby might be my next step.
I've had this problem on two separate machines running 10.4.1.

Question: How to add arbitrary fonts? Does it support ttf format?
If results of 'fc-list' command include certain font, that font can be
used in pdf-writer? And does it support m17n?

···

--
http://nohmad.sub-port.net

Jamis Buck <jamis@37signals.com> writes:

This is very odd. All the JPEGs open fine in an image editor, but
they don't work with PDF::Writer...

Jamis, did you compile your own version of Ruby or patch the version
that Apple distributes (I believe I used the Ruby on Rails installer
for Tiger package) ? I think compiling Ruby might be my next step.
I've had this problem on two separate machines running 10.4.1.

Jason, yes, I did compile Ruby (well, used darwinports). I never even
bothered using the one that came with Tiger, after hearing lots of
people berate its brokenness.

Wasn't the default Ruby broken wrt byte-order when packing?
That could be a fair reason.

···

- Jamis

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

This is all discussed in the early chapters of the 82-page manual.
In short, both TTF and Type1 (pfb) fonts are supported, but you must
have AFM files for your font programs. You must tell PDF::Writer
where to find those AFM files; it will attempt to find your TTF or
Type1 fonts based on system directories (again, documented in the
manual).

PDF::Writer will NOT work without AFM files. Yet. That's a separate
project I'm working on (under a separate licence, because of the
licence of the origin code), but that is taking time.

How do you mean "does it support m17n"? PDF::Writer does not support
either UTF-8 or UTF-16 directly; it does support differences
encodings, and I am hoping to have a release soon that freely steals
an idea from FPDF for "code page" mappings. This may or may not be
PDF::Writer 1.1, depending on how much I get done before Friday (I
am away for the weekend).

-austin

···

On 6/15/05, Gyoung-Yoon Noh <nohmad@gmail.com> wrote:

Question: How to add arbitrary fonts? Does it support ttf format?
If results of 'fc-list' command include certain font, that font can be
used in pdf-writer? And does it support m17n?

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

This seems to be right on. After compiling a new Ruby to /usr/local,
everything is happy. Now it is time to play...

Thanks for the help all, and thanks for this great library Austin!

FWIW:

legolas:~ jason$ time techbook
Using default document
'/usr/local/lib/ruby/gems/1.8/gems/pdf-writer-1.0.1/lib/pdf/../../manual.pwd'.

real 4m27.959s
user 3m53.151s
sys 0m11.188s

Powerbook G4, 1.5 GHz, 768 MB.

Jason

···

On 6/15/05, Christian Neukirchen <chneukirchen@gmail.com> wrote:

Jamis Buck <jamis@37signals.com> writes:

>> This is very odd. All the JPEGs open fine in an image editor, but
>> they don't work with PDF::Writer...
>>
>> Jamis, did you compile your own version of Ruby or patch the version
>> that Apple distributes (I believe I used the Ruby on Rails installer
>> for Tiger package) ? I think compiling Ruby might be my next step.
>> I've had this problem on two separate machines running 10.4.1.
>>
>
> Jason, yes, I did compile Ruby (well, used darwinports). I never even
> bothered using the one that came with Tiger, after hearing lots of
> people berate its brokenness.

Wasn't the default Ruby broken wrt byte-order when packing?
That could be a fair reason.

> - Jamis
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org