Goal
Create PDFs from scratch, add/remove pages and objects, save to file or bytes.
Tasks
Add creation FFI: FPDF_CreateNewDocument, FPDFPage_New, FPDFPage_Delete, FPDFPageObj_CreateTextObj, FPDFPage_InsertObject, FPDFPage_RemoveObject, FPDFPage_GenerateContent, FPDF_SaveAsCopy
Add font FFI: FPDFText_LoadFont, FPDFText_LoadStandardFont
Implement Document::new(), Document::create_page(), Document::delete_page()
Implement FontRef and Document::add_builtin_font(), Document::add_font_from_bytes()
Implement object creation: create_text_object(), create_path_object(), create_image_object()
Implement Document::remove_object(), Document::move_object_to_page()
Implement content regeneration tracking (needs_content_regen flag on PageData)
Implement Document::save(), Document::to_bytes(), Document::write_to()
Tests: create PDF from scratch with text and images, save, re-open and verify content
Write examples/create.rs
Exit Criterion
Can create a multi-page PDF with text and images from scratch, save it, and re-open it successfully.
Dependencies
Goal
Create PDFs from scratch, add/remove pages and objects, save to file or bytes.
Tasks
FPDF_CreateNewDocument,FPDFPage_New,FPDFPage_Delete,FPDFPageObj_CreateTextObj,FPDFPage_InsertObject,FPDFPage_RemoveObject,FPDFPage_GenerateContent,FPDF_SaveAsCopyFPDFText_LoadFont,FPDFText_LoadStandardFontDocument::new(),Document::create_page(),Document::delete_page()FontRefandDocument::add_builtin_font(),Document::add_font_from_bytes()create_text_object(),create_path_object(),create_image_object()Document::remove_object(),Document::move_object_to_page()needs_content_regenflag onPageData)Document::save(),Document::to_bytes(),Document::write_to()examples/create.rsExit Criterion
Can create a multi-page PDF with text and images from scratch, save it, and re-open it successfully.
Dependencies