~ireas

Trackers

~ireas/genpdf-rs

Last active 1 year, 2 months ago

~ireas/rusty-man

Last active 1 year, 5 months ago

~ireas/nitrokey-rs

Last active 2 years ago

#37 Add fill color for frames 6 months ago

on ~ireas/genpdf-rs

I’ve added the Area::next_layer on the master branch, so feel free to submit a patch for this feature.

~ireas (and ~ap4sc) would it be ok if I did this?

#65 Page numbering 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago

Comment by ~ireas on ~ireas/genpdf-rs

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

#63 More text effects 2 years 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.