Generate a 6" x 9" PDF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Generate a 6" x 9" PDF

wintermeyer
Hi,

I'd like to publish a book with https://www.createspace.com/ and their
default page size is 6" x 9". Long story short: I don't know how to create
such a PDF with asciidoctor-pdf.

I guess :pdf-page-size: is the key but I don't know what to set there.

While at it I'd like to use a smaller font.

What do I have to set for both?

  Stefan
Ted
Reply | Threaded
Open this post in threaded view
|

Re: Generate a 6" x 9" PDF

Ted
I would like to know how this works too. I've experimented a bit. As you figured out you can change the page size

= My Test Document
:pdf-page-size: A5

Then when you render it
> asciidoctor-pdf MyTestDocument.adoc

it produces a .pdf with page size 5.83 x 8.27 in

Does anyone know how to set it in inches?

I tried 6x9 and 6"x9" and both end up being ignored and the .pdf comes out as 8.27 x 11.69 in


You can change the font by creating a style in a .yml file

You can start with this https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/base-theme.yml
(Notice the page_size: A4. You could set it here instead of inside your .adoc file)

Save base-theme.yml in a directory MyThemes. After you've made your font changes, render it like this

> asciidoctor-pdf -a pdf-stylesdir=MyThemes -a pdf-style=base MyTestDocument.adoc

The -a pdf-style=base will look for a "base-theme-yml" file in your "MyThemes" directory

For more information about PDF Themes: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc


- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: Generate a 6" x 9" PDF

mojavelinux
Administrator
The PDF page size can be specified using one of the following:

* A named size, as defined by the PDF specification (see https://github.com/prawnpdf/pdf-core/blob/master/lib/pdf/core/page_geometry.rb#L16-L68)

In your case, you can see the page size as follows:

:pdf-page-size: 6in x 9in

The documentation definition needs to clarify that the page size can be controlled using the pdf-page-size attribute.

(We could also consider supporting double quote as a valid measurement unit, so that 6" x 9" would work. If you'd like to see that, please file an issue).

Cheers,

-Dan

On Mon, Feb 8, 2016 at 9:54 AM, Ted [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I would like to know how this works too. I've experimented a bit. As you figured out you can change the page size

= My Test Document
:pdf-page-size: A5

Then when you render it
> asciidoctor-pdf MyTestDocument.adoc

it produces a .pdf with page size 5.83 x 8.27 in

Does anyone know how to set it in inches?

I tried 6x9 and 6"x9" and both end up being ignored and the .pdf comes out as 8.27 x 11.69 in


You can change the font by creating a style in a .yml file

You can start with this https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/base-theme.yml
(Notice the page_size: A4. You could set it here instead of inside your .adoc file)

Save base-theme.yml in a directory MyThemes. After you've made your font changes, render it like this

> asciidoctor-pdf -a pdf-stylesdir=MyThemes -a pdf-style=base MyTestDocument.adoc

The -a pdf-style=base will look for a "base-theme-yml" file in your "MyThemes" directory

For more information about PDF Themes: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc


- Ted @TedAtCIS



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Generate-a-6-x-9-PDF-tp4276p4279.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen