static void Main() { // create host for PHP code (Runtime Context): using (var ctx = Context.CreateConsole(null)) { var pdf = new FPDF(ctx); pdf.AddPage(); pdf.SetFont("Arial"); pdf.Cell(40, 10, "Hello World!"); pdf.Output("F", "tuto1.pdf"); } }
static void Main() { // sideload assembly containing compiled PHP code: Context.AddScriptReference(Assembly.Load(new AssemblyName("fpdf"))); // create host for PHP code (Runtime Context): using (var ctx = Context.CreateConsole(null)) { var pdf = new FPDF(ctx); pdf.AddPage(); pdf.SetFont("Arial"); pdf.Cell(40, 10, "Hello World!"); pdf.Output("F", "tuto1.pdf"); } }
public static void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { lock (LockString) { Imports.FPDF_RenderPageBitmap(bitmapHandle, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static void FPDF_RenderPage(IntPtr dc, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { lock (LockString) { Imports.FPDF_RenderPage(dc, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static extern void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
public static extern void FPDF_RenderPage(IntPtr dc, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
public bool RenderPageToDC(int pageIndex, IntPtr dc, int dpiX, int dpiY, int boundsOriginX, int boundsOriginY, int boundsWidth, int boundsHeight, FPDF flags) { if (_disposed) { throw new ObjectDisposedException(GetType().Name); } using (var pdfData = new PdfData(_document, _form, pageIndex)) { PdfiumLibrary.FPDF_RenderPage(dc, pdfData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, 0, flags); } return(true); }
public void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { lock (_Lock) { this.FPDF_RenderPageBitmap(bitmapHandle, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public void FPDF_RenderPage(IntPtr dc, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { lock (_Lock) { this.FPDF_RenderPage(dc, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static void FPDF_FFLDraw(IntPtr form, IntPtr bitmap, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { if (!_dllLoaded) { return; } lock (_mutex) { API.FPDF_FFLDraw(form, bitmap, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { if (!_dllLoaded) { return; } lock (_mutex) { API.FPDF_RenderPageBitmap(bitmapHandle, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static void GetFPDFRenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int startX, int startY, int sizeX, int sizeY, int rotate, FPDF flags) { NativeMethods.FPDF_RenderPageBitmap(bitmapHandle, page, startX, startY, sizeX, sizeY, rotate, flags); }
public static void FPDF_FFLDraw(IntPtr form, IntPtr bitmap, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags) { lock (LockString) { Imports.FPDF_FFLDraw(form, bitmap, page, start_x, start_y, size_x, size_y, rotate, flags); } }
public static extern void FPDF_FFLDraw(IntPtr form, IntPtr bitmap, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
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); }