pub fn render(&mut self) {
        if self.is_rendered {
            // The page has already been rendered.

            return;
        }

        // Clear the bitmap buffer by setting every pixel to white.

        self.bindings.FPDFBitmap_FillRect(
            self.handle,
            0,
            0,
            self.config.width,
            self.config.height,
            PdfColor::SOLID_WHITE.as_pdfium_color(),
        );

        // Render the PDF page into the bitmap buffer.

        self.bindings.FPDF_RenderPageBitmap(
            self.handle,
            *self.page.get_handle(),
            0,
            0,
            self.config.width,
            self.config.height,
            self.config.rotate,
            self.config.render_flags,
        );

        if let Some(form) = self.document.form() {
            if self.config.do_render_form_data {
                // Render user-supplied form data, if any, as an overlay on top of the page.

                for (form_field_type, (color, alpha)) in self.config.form_field_highlight.iter() {
                    self.bindings.FPDF_SetFormFieldHighlightColor(
                        *form.get_handle(),
                        *form_field_type,
                        *color,
                    );

                    self.bindings
                        .FPDF_SetFormFieldHighlightAlpha(*form.get_handle(), *alpha);
                }

                self.bindings.FPDF_FFLDraw(
                    *form.get_handle(),
                    self.handle,
                    *self.page.get_handle(),
                    0,
                    0,
                    self.config.width,
                    self.config.height,
                    self.config.rotate,
                    self.config.render_flags,
                );
            }
        }

        self.is_rendered = true;
    }
/// Renders this page into a bitmap buffer. Once rendered, the page will not be
/// re-rendered.
///
/// It is generally unnecessary to call this function directly, since PdfBitmap
/// will automatically initiate rendering itself on the first call to either
/// the [PdfBitmap::as_bytes()] function or the [PdfBitmap::as_image()] function.
Renders this page into a bitmap buffer. Once rendered, the page will not be
re-rendered.

It is generally unnecessary to call this function directly, since PdfBitmap
will automatically initiate rendering itself on the first call to either
the [PdfBitmap::as_bytes()] function or the [PdfBitmap::as_image()] function.
Renders this page into a bitmap buffer . Once rendered the page will not be re - rendered . It is generally unnecessary to call this function directly since PdfBitmap will automatically initiate rendering itself on the first call to either the [ PdfBitmap :: as_bytes () ] function or the [ PdfBitmap :: as_image () ] function .
pub fn render(&mut self) {
        if self.is_rendered {
            // The page has already been rendered.
            return;
        }
        // Clear the bitmap buffer by setting every pixel to white.
        self.bindings.FPDFBitmap_FillRect(
            self.handle,
            0,
            0,
            self.config.width,
            self.config.height,
            PdfColor::SOLID_WHITE.as_pdfium_color(),
        );
        // Render the PDF page into the bitmap buffer.
        self.bindings.FPDF_RenderPageBitmap(
            self.handle,
            *self.page.get_handle(),
            0,
            0,
            self.config.width,
            self.config.height,
            self.config.rotate,
            self.config.render_flags,
        );
        if let Some(form) = self.document.form() {
            if self.config.do_render_form_data {
                // Render user-supplied form data, if any, as an overlay on top of the page.
                for (form_field_type, (color, alpha)) in self.config.form_field_highlight.iter() {
                    self.bindings.FPDF_SetFormFieldHighlightColor(
                        *form.get_handle(),
                        *form_field_type,
                        *color,
                    );
                    self.bindings
                        .FPDF_SetFormFieldHighlightAlpha(*form.get_handle(), *alpha);
                }
                self.bindings.FPDF_FFLDraw(
                    *form.get_handle(),
                    self.handle,
                    *self.page.get_handle(),
                    0,
                    0,
                    self.config.width,
                    self.config.height,
                    self.config.rotate,
                    self.config.render_flags,
                );
            }
        }
        self.is_rendered = true;
    }
pub fn render ( & mut self ) { if self . is_rendered { // The page has already been rendered. return ; } // Clear the bitmap buffer by setting every pixel to white. self . bindings . FPDFBitmap_FillRect ( self . handle , 0 , 0 , self . config . width , self . config . height , PdfColor :: SOLID_WHITE . as_pdfium_color ( ) , ) ; // Render the PDF page into the bitmap buffer. self . bindings . FPDF_RenderPageBitmap ( self . handle , * self . page . get_handle ( ) , 0 , 0 , self . config . width , self . config . height , self . config . rotate , self . config . render_flags , ) ; if let Some ( form ) = self . document . form ( ) { if self . config . do_render_form_data { // Render user-supplied form data, if any, as an overlay on top of the page. for ( form_field_type , ( color , alpha ) ) in self . config . form_field_highlight . iter ( ) { self . bindings . FPDF_SetFormFieldHighlightColor ( * form . get_handle ( ) , * form_field_type , * color , ) ; self . bindings . FPDF_SetFormFieldHighlightAlpha ( * form . get_handle ( ) , * alpha ) ; } self . bindings . FPDF_FFLDraw ( * form . get_handle ( ) , self . handle , * self . page . get_handle ( ) , 0 , 0 , self . config . width , self . config . height , self . config . rotate , self . config . render_flags , ) ; } } self . is_rendered = true ; }
Renders this page into a bitmap buffer.
Renders this page into a bitmap buffer .
&mut self
&mut self