printpdf
printpdf copied to clipboard
`with_pages` documentation does not agree with implementation
PdfDocument in lib.rs has a method with_pages that states
/// Replaces
document.pageswith the new pages
However, the implementation uses append
pub fn with_pages(&mut self, pages: Vec<PdfPage>) -> &mut Self {
let mut pages = pages;
self.pages.append(&mut pages);
self
}
Not sure what the intended behaviour is, both appending and replacing may be useful.
Yeah, it should append the pages, so that you can do PdfDocument::new("title").with_pages(pages).save(options);
I think the pages field is public, so then you could just replace it yourself.