Set target resolution in asciidoctor-pdf and asciidoctor-fop?

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

Set target resolution in asciidoctor-pdf and asciidoctor-fop?

getreu
How can I set the output resolution of embedded images when they are rendered into pdf by asciidoctor-pdf and asciidoctor-fop?

I tried some -parm without success.
Reply | Threaded
Open this post in threaded view
|

Re: Set target resolution in asciidoctor-pdf and asciidoctor-fop?

mojavelinux
Administrator
In Asciidoctor PDF, you'll want to use the scaledwidth attribute on the image block for this. It's a percentage width of the page (on a scale of 0 to 100). If you don't specify it, it defaults to the scaled_width_default setting in the image node in the theme, or 75% if not specified in the theme. Currently, Asciidoctor PDF doesn't support any other type of scaling of images (it's opinionated atm, though likely we'll add flexibility in the future).

See: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/converter.rb#L578

As for fopub, it's complicated and I can't remember off the type of my head. I think it honors scaledwidth, but I'd have to test it to know. One of the reasons I'm moving away from fopub (and DocBook in general) is because it's just too complex to configure. We are shooting for a nice, CSS-inspired balance in Asciidoctor PDF...though clearly we still have a ways to go.

I want to clarify that, personally, I'm not developing on fopub anymore. I'm focusing all my attention on the PDF format to Asciidoctor PDF. I'm perfectly happy to help merge in pull requests from others for fopub (I'm certainly not standing in the way of progress), but it depresses and bores me too much to work on the DocBook toolchain. I'm set on displacing it.

Cheers,

-Dan

On Tue, Dec 9, 2014 at 11:14 AM, getreu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
How can I set the output resolution of embedded images when they are rendered into pdf by asciidoctor-pdf and asciidoctor-fop?

I tried some -parm without success.



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Set-target-resolution-in-asciidoctor-pdf-and-asciidoctor-fop-tp2514.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Set target resolution in asciidoctor-pdf and asciidoctor-fop?

getreu
Many thanks for the prompt reply.

I actually meant something else:

Does asciidoctor-pdf or asciidoctor-fop change the resolution of the embedded images? If yes how can I control it?
I know that the optimize-pdf script does, but what about asciidoctor-pdf and asciidoctor-fop?

I rendered a document with embedded 600DPI images and the print quality was very poor. I tried both asciidoctor-pdf and asciidoctor-fop. In the meantime I found out, that the quality depends on the printer used: the Ricoh printers at work do not print the images in the original resolution. On my HP at home the result is much better. I guess it must be some printer setting.

PS:

> I want to clarify that, personally, I'm not developing on fopub anymore. I'm focusing all my attention on the PDF
> format to Asciidoctor PDF. I'm perfectly happy to help merge in pull requests from others for fopub (I'm certainly
> not standing in the way of progress), but it depresses and bores me too much to work on the DocBook toolchain.
> I'm set on displacing it.

The toolchain and especially the docbook backend is very important for production environments. Will the docbook backend be supported in the future?



Reply | Threaded
Open this post in threaded view
|

Re: Set target resolution in asciidoctor-pdf and asciidoctor-fop?

mojavelinux
Administrator

On Thu, Dec 11, 2014 at 12:58 AM, getreu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Does asciidoctor-pdf or asciidoctor-fop change the resolution of the embedded images? If yes how can I control it?
I know that the optimize-pdf script does, but what about asciidoctor-pdf and asciidoctor-fop?

I rendered a document with embedded 600DPI images and the print quality was very poor. I tried both asciidoctor-pdf and asciidoctor-fop. In the meantime I found out, that the quality depends on the printer used: the Ricoh printers at work do not print the images in the original resolution. On my HP at home the result is much better. I guess it must be some printer setting.

I do know that Prawn does process the images in some way. My advise is to dig into some basic examples of Prawn adding images to a PDF and see what you can discover. If you find that Prawn can do something that Asciidoctor PDF is not honoring, then we can fix it up.

The Prawn manual is quite good and Prawn is fun to play with by itself. Experiment there and then we can circle back and see what changes we need to make in Asciidoctor PDF.

 


The toolchain and especially the docbook backend is very important for production environments. Will the docbook backend be supported in the future?

Absolutely. We will continue to produce DocBook. It's a very important exchange format. I have no problem with DocBook itself (except writing in it, but that's why we have AsciiDoc!)

I just don't want to spend time working on the DocBook-to-layout conversion process (which is what fopub wraps, similar to what a2x does). There are plenty of other people (with more expertise) that are focused on that part of the equation (including the DocBook toolchain team themselves). My focus will be on what we can do direct from AsciiDoc...and of course making Asciidoctor rock the house.