Esempio n. 1
0
        public bool RenderPageToBitmap(int pageIndex, IntPtr bitmapHandle, int dpiX, int dpiY, int boundsOriginX, int boundsOriginY, int boundsWidth, int boundsHeight, int rotate, FPDF flags, bool renderFormFill)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }

            using (var pdfData = new PdfData(_document, _form, pageIndex))
            {
                if (renderFormFill)
                {
                    flags &= ~FPDF.ANNOT;
                }

                PdfiumLibrary.FPDF_RenderPageBitmap(bitmapHandle, pdfData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, rotate, flags);

                if (renderFormFill)
                {
                    PdfiumLibrary.FPDF_FFLDraw(_form, bitmapHandle, pdfData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, rotate, flags);
                }
            }

            return(true);
        }