coudn't find FPDF_RenderPage function
CaiZhibo opened this issue · 2 comments
CaiZhibo commented
I need to render pages to printer, but couldn't find the function FPDF_RenderPage.
DJGosnell commented
After doing some research, FPDF_RenderPage is a WIN32 method only. See partial fpdfview.h
header below. We use CppSharp to generate the bindings from the header files of the binaries and I'm unsure how we could handle platform specific calls in a multi-platform project like this without generating the bindings twice.
I am open to suggestions on how to accomplish this.
#ifdef _WIN32
// Function: FPDF_RenderPage
// Render contents of a page to a device (screen, bitmap, or printer).
// This function is only supported on Windows.
// Parameters:
// dc - Handle to the device context.
// page - Handle to the page. Returned by FPDF_LoadPage.
// start_x - Left pixel position of the display area in
// device coordinates.
// start_y - Top pixel position of the display area in device
// coordinates.
// size_x - Horizontal size (in pixels) for displaying the page.
// size_y - Vertical size (in pixels) for displaying the page.
// rotate - Page orientation:
// 0 (normal)
// 1 (rotated 90 degrees clockwise)
// 2 (rotated 180 degrees)
// 3 (rotated 90 degrees counter-clockwise)
// flags - 0 for normal display, or combination of flags
// defined above.
// Return value:
// None.
FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
FPDF_PAGE page,
int start_x,
int start_y,
int size_x,
int size_y,
int rotate,
int flags);
#endif
DJGosnell commented
If someone has a proposal on how to handle this, please open a PR and we can discuss it further.