Re: wrapper for pdfium
- Posted by begin Feb 21, 2018
- 3062 views
a short test.
how do i allocate memory for doubles and float and then read it as numbers?
OK i found out. sorry.
object result = 0 atom width = allocate(8), height = allocate(8) atom docHandle c_proc(FPDF_InitLibrary) constant book = allocate_string("3658071664.pdf") docHandle = c_func(FPDF_LoadDocument, {book, 0}) delete(book) integer j = c_func(FPDF_GetPageCount, {docHandle}) integer i = c_func(FPDF_GetPageSizeByIndex, {docHandle, 100, width, height}) c_proc(FPDF_CloseDocument,{docHandle}) c_proc(FPDF_DestroyLibrary) ?j ?i object result = 0 atom width = allocate(8) atom height = allocate(8) atom docHandle c_proc(FPDF_InitLibrary) constant book = mem:allocate_string("3658071664.pdf") docHandle = c_func(FPDF_LoadDocument, {book, 0}) delete(book) integer j = c_func(FPDF_GetPageCount, {docHandle}) integer i = c_func(FPDF_GetPageSizeByIndex, {docHandle, 100, width, height}) c_proc(FPDF_CloseDocument,{docHandle}) c_proc(FPDF_DestroyLibrary) ?j ?i ?float64_to_atom(peek({width, 8})) ?float64_to_atom(peek({height, 8})) delete(width) delete(height) wait_key()