Skip to content

Phase 6: Document Creation and Mutation #7

@tlkahn

Description

@tlkahn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions