android - how to create a pdf document with bitmap use pdfium? -
i have tried pdfium produce pdf in android4.3. have not idea how add bitmap fpdf_page. test source code:
int main(){ fpdf_initlibrary(); fpdf_document ppdfdoc = fpdf_createnewdocument(); //insert fpdf_page pdf_page = fpdfpage_new(ppdfdoc,0,500,600); fpdf_pageobject object = fpdfpageobj_newimgeobj(ppdfdoc); //add bitmap object. //what should here???? fpdfpage_generatecontent(pdf_page); fpdfpage_insertobject(pdf_page, object); int fd = open("/sdcard/temp.pdf",o_rdwr|o_creat); if (fd < 1) { printf("cannot write file descriptor. %d : error:%d", fd,errno); } writepdf(ppdfdoc,fd); fpdf_destroylibrary(); return 0; }
thank you!!
there fpdfimageobj_setbitmap can used set fpdf_bitmap image object.
Comments
Post a Comment