/// Returns a string containing the SVG representing the QR-Bill
///
/// * `full_page`: Makes the generated SVG the size of a full A4 page.
Returns a string containing the SVG representing the QR-Bill
`full_page`: Makes the generated SVG the size of a full A4 page.
Returns a string containing the SVG representing the QR - Bill ` full_page ` : Makes the generated SVG the size of a full A4 page .
pub fn create_svg(&self, full_page: bool) -> Result<String, Error> {
        // Make a properly sized document with a correct viewbox.
        let document = if full_page {
            Document::new()
                .set("width", format!("{}mm", A4_WIDTH_IN_MM))
                .set("height", format!("{}mm", A4_HEIGHT_IN_MM))
                .set("viewBox", format!("0 0 {} {}", A4_WIDTH, A4_HEIGHT))
        } else {
            Document::new()
                .set("width", format!("{}mm", A4_WIDTH_IN_MM))
                .set("height", format!("{}mm", BILL_HEIGHT_IN_MM))
                .set("viewBox", format!("0 0 {} {}", A4_WIDTH, BILL_HEIGHT))
        };
        // White background.
        let mut document = document.add(
            Rectangle::new()
                .set("x", 0.0)
                .set("y", 0.0)
                .set("width", "100%")
                .set("height", "100%")
                .set("fill", "white"),
        );
        let mut bill_group = self.draw_bill()?;
        if full_page {
            bill_group = self.transform_to_full_page(bill_group);
        }
        document = document.add(bill_group);
        Ok(document.to_string())
    }
pub fn create_svg ( & self , full_page : bool ) -> Result < String , Error > { // Make a properly sized document with a correct viewbox. let document = if full_page { Document :: new ( ) . set ( " " , format ! ( " " A4_WIDTH_IN_MM ) ) . set ( " " , format ! ( " " A4_HEIGHT_IN_MM ) ) . set ( " " , format ! ( " " A4_WIDTH A4_HEIGHT ) ) } else { Document :: new ( ) . set ( " " , format ! ( " " A4_WIDTH_IN_MM ) ) . set ( " " , format ! ( " " BILL_HEIGHT_IN_MM ) ) . set ( " " , format ! ( " " A4_WIDTH BILL_HEIGHT ) ) } ; // White background. let mut document = document . add ( Rectangle :: new ( ) . set ( " " , 0.0 ) . set ( " " , 0.0 ) . set ( " " , " " ) . set ( " " , " " ) . set ( " " , " " ) , ) ; let mut bill_group = self . draw_bill ( ) ? ; if full_page { bill_group = self . transform_to_full_page ( bill_group ) ; } document = document . add ( bill_group ) ; Ok ( document . to_string ( ) ) }
Returns a string containing the SVG representing the QR-Bill
 `full_page`: Makes the generated SVG the size of a full A4 page.
Returns a string containing the SVG representing the QR - Bill ` full_page ` : Makes the generated SVG the size of a full A4 page .
&self
full_page
bool