Forum How do I...?

--no-author-style and HTML style-attribute

wulfila
I upgraded from Prince 7.1 to 8.1. On comparing PDF output generated by both versions, I noticed Prince no longer seems to look at local style-attributes on elements in the HTML file.

Both files were generated from the command line, before and after installing Prince 8.1, using these options:
--style=prince.css --media=print --no-author-style

Is it possible that the implementation of --no-author-style has changed, so that Prince not only ignores author stylesheets, but also local style-attributes? If so, is there a way to avoid this? (I want to override author stylesheets, but not style-attributes.)

I tried to search the forum, but the search engine doesn't cope very well with "--no-author-style".

Thanks,
Tom De Herdt

Tom De Herdt

Edited by wulfila

wulfila
Well, this embarrassing. It appears that --no-author-style ignored style-attributes in 7.1 as well.

I was misled into believing that the attribute was ignored in 8.1 because images in the file were over-sized. They have width:xx% style hints in the style-attribute on the img tag, which didn't seem to have any effect in 8.1.

What really happened is that the default image resolution and max size have changed in 8.0, as documented in the release notes.

My apologies.

(I still wonder though if there is a clean way to override author stylesheets, but not style-attributes. This could make sense when an author has no control over document stylesheets, but can override them in style-attributes. You may want to preserve these when printing. But it's probably not a common scenario (nor very safe).)

Tom De Herdt

mikeday
Now that Prince supports JavaScript, it would be possible to write a short script that removes <style> or <link rel="stylesheet"> elements from the document, effectively disabling author style sheets without affecting the style attribute.
wulfila
Thank you, that is indeed a good solution, and more fine-grained than a command switch: it allows me to ignore some stylesheets, while keeping others.

Tom De Herdt