I am looking for a PDF creation library that will work like the C++ library I created years ago. I need to wrap the PDF library in my own struct with its own methods, but so far the two libraries I've looked at won't let me do that.
The basic idea will look something like:
pub struct Printer {
document: pdfdoc,
current_page: pdfpage,
{ various style state fields }
}
impl Printer {
pub fn new(...) -> Self;
pub fn SetTypeSpacing(&mut self,spacing: TypeSpacing) -> bool;
pub fn SetTypeSlant(&mut self,slant: TypeSlant) -> bool;
pub fn SetTypeWeight(&mut self,weight: TypeWeight) -> bool;
pub fn NewPage(&mut self,heading: &String) -> bool;
pub fn PutLine(&mut self,line: &String) -> bool;
pub fn Tab(&mut self, column: u8) -> bool;
}
pub trait __Put<T> {
fn Put(&mut self,object: T) -> bool;
}
The PDFs my package will be creating will only have plain text and only use the Courier font family. At this point I am seriously thinking of just piping plain text through a2ps & ps2pdf. It might actually be easier. It work loose any possibility of easy cross-platform usablity though.