~ireas

Trackers

~ireas/genpdf-rs

Last active a month ago

~ireas/rusty-man

Last active 4 months ago

~ireas/nitrokey-rs

Last active 9 months ago

#65 Page numbering 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

I can print a header, but I cannot find how to print a footer.

It is not supported by SimplePageDecorator at the moment because you have to specify the position of the top-left corner of an element before rendering it. As you cannot determine the height of an element without rendering it, it is hard to do that for a footer with generic elements.

But if you use a fixed height for the footer, you can create your own PageDecorator implementation that uses the fixed height to calculate the position of the element before rendering it.

In the long-term, the Element trait should be extended to provide a size estimate without rendering the element. Then we could add a generic add_footer method to SimplePageDecorator.

#64 SVG support 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

Potentially, for very simple graphs, Area::draw_line could be used. But other than that, it is currently not possible to do it only with genpdf.

#65 Page numbering 3 months ago

on ~ireas/genpdf-rs

On 10/12/22 14:11, ~ireas wrote:

Adding page numbers is already possible as demonstrated in the demo example (PDF). Adding the total page number would be nice but pretty hard to implement with the current rendering process.

I can print a header, but I cannot find how to print a footer.

-- Carlo Milanesi

#64 SVG support 3 months ago

on ~ireas/genpdf-rs

On 10/12/22 14:08, ~ireas wrote:

This would be a very nice feature. According to its readme, printpdf (that is used internally by genpdf) does not support SVG yet, but there is a Svg struct that looks like it could work.

#I am writing a book for Manning. It will describe Genpdf, but it will not not describe Printpdf. I don't have time to discover how to insert a non-documented Printpdf object inside a Genpdf document. So, I am going to write that Genpdf cannot create documents containing charts.

Carlo Milanesi

#65 Page numbering 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

Adding page numbers is already possible as demonstrated in the demo example (PDF). Adding the total page number would be nice but pretty hard to implement with the current rendering process.

#64 SVG support 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

This would be a very nice feature. According to its readme, printpdf (that is used internally by genpdf) does not support SVG yet, but there is a Svg struct that looks like it could work.

#63 More text effects 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

The main point where you want to use it is the Element::render method. Maybe this section in the docs or looking at the implementation of Element for e. g. Text helps?

#19 Explicit line breaks inside of paragraphs 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

Yes, I think this is the best workaround at the moment.

#63 More text effects 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

text-style only provides types and conversions between different type systems. The rendering has to be implemented in genpdf::render::TextSection, probably by setting the appropriate flags in printpdf.

#62 Do we have option to set fill color for framed element? 3 months ago

Comment by ~ireas on ~ireas/genpdf-rs

As far as I see, this is not possible at the moment. This first step for implementing this would be adding it to the Area struct. This would also require changes to the Style system because there currently is way to specifiy a background color.