### Install office2pdf CLI Source: https://github.com/developer0hye/office2pdf/blob/main/README.md Install the command-line interface via cargo. ```sh cargo install office2pdf-cli ``` -------------------------------- ### Perform basic CLI conversions Source: https://context7.com/developer0hye/office2pdf/llms.txt Examples of single file, batch, and parallel conversion using the CLI tool. ```bash # Convert a single DOCX file (output: report.pdf) office2pdf report.docx # Convert with explicit output path office2pdf report.docx -o output.pdf # Batch convert multiple files office2pdf *.docx --outdir pdfs/ # Parallel batch conversion (use all CPU cores) office2pdf *.pptx --outdir pdfs/ -j 0 ``` -------------------------------- ### Install office2pdf dependency Source: https://github.com/developer0hye/office2pdf/blob/main/README.md Add the library to your Cargo.toml file. ```toml [dependencies] office2pdf = "0.4" ``` -------------------------------- ### Execute office2pdf CLI Commands Source: https://github.com/developer0hye/office2pdf/blob/main/PRD.md Provides examples for basic file conversion, applying conversion options, batch processing, and accessing help information. ```bash # Basic conversion office2pdf input.docx # → input.pdf office2pdf input.pptx -o output.pdf # specify output path # Options office2pdf input.xlsx --sheets "Sheet1,Sheet2" # specific sheets only office2pdf input.pptx --slides 1-5 # specific slides only office2pdf input.docx --paper a4 --landscape # paper settings office2pdf input.docx --font-path ./fonts # font path # Batch conversion office2pdf *.docx --outdir ./pdfs/ # batch convert multiple files # Info office2pdf --version office2pdf --help ``` -------------------------------- ### CLI Document Conversion and Manipulation Source: https://context7.com/developer0hye/office2pdf/llms.txt Examples of using the office2pdf command-line interface for single file conversion, streaming large files, and PDF manipulation. ```APIDOC ## CLI Usage ### Description Perform document conversions, merge/split PDF files, and view conversion metrics via the command line. ### Commands - **Convert specific slide**: `office2pdf presentation.pptx --slides 3` - **Streaming mode (large XLSX)**: `office2pdf large_spreadsheet.xlsx --streaming [--streaming-chunk-size 500]` - **Merge PDFs**: `office2pdf merge file1.pdf file2.pdf file3.pdf -o combined.pdf` - **Split PDF**: `office2pdf split document.pdf --pages 1-5,10-15 --outdir parts/` - **Show Metrics**: `office2pdf report.docx --metrics` ``` -------------------------------- ### WebAssembly (WASM) API Source: https://context7.com/developer0hye/office2pdf/llms.txt Integration guide for using office2pdf in browser or Node.js environments using WebAssembly. ```APIDOC ## WASM API ### Description Use the library in JavaScript environments by initializing the WASM module and calling conversion functions. ### Functions - `convertToPdf(bytes, format)`: Generic conversion. - `convertDocxToPdf(bytes)`: DOCX specific. - `convertPptxToPdf(bytes)`: PPTX specific. - `convertXlsxToPdf(bytes)`: XLSX specific. ``` -------------------------------- ### Get PDF page count in Rust Source: https://context7.com/developer0hye/office2pdf/llms.txt Retrieves the total number of pages in a PDF document. ```rust use std::fs; use office2pdf::pdf_ops; fn main() { let pdf_data = fs::read("document.pdf").expect("failed to read PDF"); let pages = pdf_ops::page_count(&pdf_data).expect("failed to count pages"); println!("Document has {} pages", pages); } ``` -------------------------------- ### Validate PDF/A Compliance with veraPDF Source: https://github.com/developer0hye/office2pdf/blob/main/references/verapdf.md Use this command to validate a PDF file against PDF/A-2b compliance. Ensure veraPDF is installed and accessible in your PATH. ```bash verapdf --flavour 2b output.pdf ``` -------------------------------- ### Validate PDF/UA Compliance with veraPDF Source: https://github.com/developer0hye/office2pdf/blob/main/references/verapdf.md Use this command to validate a PDF file against PDF/UA-1 compliance. Ensure veraPDF is installed and accessible in your PATH. ```bash verapdf --flavour ua1 output.pdf ``` -------------------------------- ### Get Git Contributors Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Retrieve a sorted, unique list of contributors since the previous tag. This is used for the GitHub release changelog. ```bash git log ..HEAD --format='%an' | sort -u ``` -------------------------------- ### Get Pull Request Diff Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Perform a final code review by checking the PR diff. Look for debug statements, hardcoded paths, credentials, and unused imports. ```bash gh pr diff ``` -------------------------------- ### Apply CLI conversion options Source: https://context7.com/developer0hye/office2pdf/llms.txt Configures output settings such as paper size, orientation, compliance standards, and font paths. ```bash # Set paper size (a4, letter, legal) office2pdf document.docx --paper a4 # Force landscape orientation office2pdf slides.pptx --landscape # Produce PDF/A-2b archival-compliant output office2pdf document.docx --pdf-a # Produce tagged PDF for accessibility office2pdf document.docx --tagged # Produce PDF/UA-1 compliant output (universal accessibility) office2pdf document.docx --pdf-ua # Add custom font directory office2pdf report.docx --font-path /usr/share/fonts/custom ``` -------------------------------- ### Create GitHub Release Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Use the GitHub CLI to create a new release. Ensure the version tag matches the Cargo.toml versions. ```bash gh release create v ``` -------------------------------- ### ConvertOptions Configuration Source: https://context7.com/developer0hye/office2pdf/llms.txt Detailed structure for configuring document conversion settings in Rust. ```APIDOC ## ConvertOptions Structure ### Parameters - **sheet_names** (Vec) - Optional - Filter XLSX sheets by name. - **slide_range** (SlideRange) - Optional - Filter PPTX slides by range. - **pdf_standard** (PdfStandard) - Optional - PDF compliance (e.g., PdfA2b). - **paper_size** (PaperSize) - Optional - Override paper size or custom dimensions. - **font_paths** (Vec) - Optional - Additional font directories. - **landscape** (bool) - Optional - Force orientation. - **tagged** (bool) - Required - Tagged PDF for accessibility. - **pdf_ua** (bool) - Required - PDF/UA compliance. - **streaming** (bool) - Required - Enable streaming mode. - **streaming_chunk_size** (u32) - Optional - Rows per chunk for streaming. ``` -------------------------------- ### Utilize the office2pdf Library API Source: https://github.com/developer0hye/office2pdf/blob/main/PRD.md Demonstrates basic conversion, usage with custom options, byte-based conversion, and filtering specific sheets or slides. ```rust use office2pdf::{Document, ConvertOptions, Format}; // Simple usage let pdf_bytes = office2pdf::convert("input.docx")?; std::fs::write("output.pdf", pdf_bytes)?; // With options let options = ConvertOptions::builder() .paper_size(PaperSize::A4) .font_paths(vec!["./fonts"]) .pdf_standard(PdfStandard::PdfA2b) .build(); let pdf_bytes = office2pdf::convert_with_options("input.xlsx", &options)?; // Convert from bytes let docx_bytes = std::fs::read("input.docx")?; let pdf_bytes = office2pdf::convert_bytes(&docx_bytes, Format::Docx, &options)?; // Convert specific sheets/slides only let options = ConvertOptions::builder() .sheet_names(vec!["Sheet1"]) // XLSX: specific sheets only .slide_range(1..=5) // PPTX: slides 1-5 only .build(); ``` -------------------------------- ### Convert documents using the library Source: https://github.com/developer0hye/office2pdf/blob/main/README.md Perform file conversions using simple one-liners, custom options, or in-memory byte buffers. ```rust // Simple one-liner let result = office2pdf::convert("report.docx").unwrap(); std::fs::write("report.pdf", &result.pdf).unwrap(); // With options use office2pdf::config::{ConvertOptions, PaperSize}; let options = ConvertOptions { paper_size: Some(PaperSize::A4), ..Default::default() }; let result = office2pdf::convert_with_options("slides.pptx", &options).unwrap(); std::fs::write("slides.pdf", &result.pdf).unwrap(); // In-memory conversion use office2pdf::config::Format; let docx_bytes = std::fs::read("report.docx").unwrap(); let result = office2pdf::convert_bytes( &docx_bytes, Format::Docx, &ConvertOptions::default(), ).unwrap(); std::fs::write("report.pdf", &result.pdf).unwrap(); ``` -------------------------------- ### Display Conversion Metrics Source: https://context7.com/developer0hye/office2pdf/llms.txt Shows per-stage timing and size metrics for the document conversion process. This helps in analyzing the performance of the conversion. ```bash # Show per-stage timing metrics office2pdf report.docx --metrics ``` ```text # Output example: # --- Metrics: "report.docx" --- # Parse: 12.345ms # Codegen: 5.678ms # Compile: 89.012ms # Total: 107.035ms # Input: 45678 bytes # Output: 123456 bytes # Pages: 5 ``` -------------------------------- ### Execute CLI conversion commands Source: https://github.com/developer0hye/office2pdf/blob/main/README.md Perform single file, batch, or configured conversions using the command line. ```sh # Single file office2pdf report.docx # Explicit output path office2pdf report.docx -o output.pdf # Batch conversion office2pdf *.docx --outdir pdfs/ # With options office2pdf slides.pptx --paper a4 --landscape office2pdf spreadsheet.xlsx --sheets "Sheet1,Summary" office2pdf document.docx --pdf-a office2pdf report.docx --font-path /usr/share/fonts/custom ``` -------------------------------- ### Convert Single Slide to PDF Source: https://context7.com/developer0hye/office2pdf/llms.txt Converts a specified number of slides from a presentation to PDF using the command-line interface. ```bash office2pdf presentation.pptx --slides 3 ``` -------------------------------- ### Convert Office Document with Custom Options Source: https://context7.com/developer0hye/office2pdf/llms.txt Convert documents using specific options such as paper size, slide range, sheet selection, orientation, and PDF/A compliance. Requires importing configuration types. ```rust use std::fs; use office2pdf::config::{ConvertOptions, PaperSize, PdfStandard, SlideRange}; fn main() { // Configure conversion options let options = ConvertOptions { // Set A4 paper size paper_size: Some(PaperSize::A4), // Only include slides 1-5 for PPTX files slide_range: Some(SlideRange::new(1, 5)), // Only include specific sheets for XLSX files sheet_names: Some(vec!["Summary".to_string(), "Data".to_string()]), // Force landscape orientation landscape: Some(true), // Produce PDF/A-2b archival-compliant output pdf_standard: Some(PdfStandard::PdfA2b), // Enable tagged PDF for accessibility tagged: true, // Add custom font directories font_paths: vec!["/usr/share/fonts/custom".into()], ..Default::default() }; // Convert with options let result = office2pdf::convert_with_options("presentation.pptx", &options).unwrap(); fs::write("presentation.pdf", &result.pdf).expect("failed to write PDF"); println!("Converted with {} pages", result.metrics.map(|m| m.page_count).unwrap_or(0)); } ``` -------------------------------- ### Convert Office Document to PDF Source: https://context7.com/developer0hye/office2pdf/llms.txt Use this function for straightforward conversion of Office documents to PDF. The file format is automatically detected from the extension. Ensure to handle potential conversion warnings. ```rust use std::fs; fn main() { // Convert a Word document to PDF let result = office2pdf::convert("report.docx").unwrap(); // Check for any conversion warnings if !result.warnings.is_empty() { eprintln!("{} warning(s):", result.warnings.len()); for warning in &result.warnings { eprintln!(" - {warning}"); } } // Write the PDF to disk fs::write("report.pdf", &result.pdf).expect("failed to write PDF"); println!("Wrote {} bytes to report.pdf", result.pdf.len()); } ``` -------------------------------- ### Generate Artifacts for Testing Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Run this command to generate artifacts for visual comparison testing. The `--ignored` flag is used to include ignored tests. ```bash cargo test -p office2pdf --test artifact_generator -- --ignored --nocapture ``` -------------------------------- ### Publish office2pdf-cli Crate Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Publish the office2pdf-cli crate to crates.io. This should be done after the library crate has been published. ```bash cargo publish -p office2pdf-cli ``` -------------------------------- ### Handle conversion errors in Rust Source: https://context7.com/developer0hye/office2pdf/llms.txt Demonstrates pattern matching on ConvertError and ConvertWarning types to handle specific failure scenarios. ```rust use office2pdf::error::ConvertError; fn main() { let input_path = "document.docx"; match office2pdf::convert(input_path) { Ok(result) => { // Handle warnings for warning in &result.warnings { match warning { office2pdf::error::ConvertWarning::UnsupportedElement { format, element } => { eprintln!("[{}] Unsupported: {}", format, element); } office2pdf::error::ConvertWarning::PartialElement { format, element, detail } => { eprintln!("[{}] Partial {}: {}", format, element, detail); } office2pdf::error::ConvertWarning::FallbackUsed { format, from, to } => { eprintln!("[{}] Fallback: {} -> {}", format, from, to); } office2pdf::error::ConvertWarning::ParseSkipped { format, reason } => { eprintln!("[{}] Skipped: {}", format, reason); } } } std::fs::write("output.pdf", &result.pdf).unwrap(); } Err(ConvertError::UnsupportedFormat(ext)) => { eprintln!("Unsupported file format: {}", ext); } Err(ConvertError::Io(e)) => { eprintln!("I/O error: {}", e); } Err(ConvertError::Parse(msg)) => { eprintln!("Parse error: {}", msg); } Err(ConvertError::Render(msg)) => { eprintln!("Render error: {}", msg); } Err(ConvertError::UnsupportedEncryption) => { eprintln!("File is password-protected and cannot be converted"); } } } ``` -------------------------------- ### Simple File Conversion Source: https://context7.com/developer0hye/office2pdf/llms.txt Converts an Office document to PDF using automatic format detection based on the file extension. ```APIDOC ## Rust: office2pdf::convert ### Description Converts a file from the filesystem to PDF. The format is automatically detected from the file extension. ### Parameters - **path** (string) - Required - The path to the source document (DOCX, PPTX, or XLSX). ### Response - **result** (struct) - Contains the generated PDF bytes and any conversion warnings. ``` -------------------------------- ### Publish office2pdf Crate Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Publish the office2pdf library crate to crates.io. This should be done before publishing the CLI. ```bash cargo publish -p office2pdf ``` -------------------------------- ### WebAssembly (WASM) API Usage for Document Conversion Source: https://context7.com/developer0hye/office2pdf/llms.txt Demonstrates how to use the office2pdf WebAssembly API in browser or Node.js environments to convert documents to PDF. It includes initializing the WASM module and handling file input/output. ```javascript // Build with: wasm-pack build crates/office2pdf --target web --features wasm import init, { convertToPdf, convertDocxToPdf, convertPptxToPdf, convertXlsxToPdf } from './pkg/office2pdf.js'; async function convertDocument() { // Initialize the WASM module await init(); // Read file from input element or fetch const fileInput = document.getElementById('file-input'); const file = fileInput.files[0]; const arrayBuffer = await file.arrayBuffer(); const inputBytes = new Uint8Array(arrayBuffer); try { // Option 1: Generic conversion with format string const pdfBytes = convertToPdf(inputBytes, "docx"); // Option 2: Format-specific functions // const pdfBytes = convertDocxToPdf(inputBytes); // const pdfBytes = convertPptxToPdf(inputBytes); // const pdfBytes = convertXlsxToPdf(inputBytes); // Create download link const blob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'converted.pdf'; a.click(); URL.revokeObjectURL(url); } catch (error) { console.error('Conversion failed:', error); } } ``` -------------------------------- ### Build and use office2pdf with WASM Source: https://github.com/developer0hye/office2pdf/blob/main/README.md Compile the library for WASM and use it within JavaScript environments. ```sh wasm-pack build crates/office2pdf --target web --features wasm ``` ```js import init, { convertDocxToPdf, convertToPdf } from './pkg/office2pdf.js'; await init(); const docxBytes = new Uint8Array(await file.arrayBuffer()); const pdfBytes = convertDocxToPdf(docxBytes); // Or use the generic API with a format string const pdfBytes2 = convertToPdf(xlsxBytes, "xlsx"); ``` -------------------------------- ### Convert Office Document from Bytes Source: https://context7.com/developer0hye/office2pdf/llms.txt Convert Office documents directly from in-memory byte slices. This method is suitable for all platforms, including WebAssembly, and allows format detection or explicit specification. ```rust use std::fs; use office2pdf::config::{ConvertOptions, Format}; fn main() { // Read the file into memory let xlsx_bytes = fs::read("spreadsheet.xlsx").expect("failed to read file"); // Detect format from extension or specify directly let format = Format::from_extension("xlsx").expect("unsupported format"); // Convert from bytes with default options let result = office2pdf::convert_bytes( &xlsx_bytes, format, &ConvertOptions::default(), ).unwrap(); fs::write("spreadsheet.pdf", &result.pdf).expect("failed to write PDF"); println!( "Converted {} bytes of XLSX to {} bytes of PDF", xlsx_bytes.len(), result.pdf.len() ); } ``` -------------------------------- ### Filter content via CLI Source: https://context7.com/developer0hye/office2pdf/llms.txt Limits conversion to specific sheets in spreadsheets or slide ranges in presentations. ```bash # Include only specific XLSX sheets (comma-separated) office2pdf spreadsheet.xlsx --sheets "Sheet1,Summary" # Include only specific slide range for PPTX office2pdf presentation.pptx --slides 1-5 ``` -------------------------------- ### Conversion with Custom Options Source: https://context7.com/developer0hye/office2pdf/llms.txt Converts documents with specific configuration parameters such as paper size, slide ranges, and PDF standards. ```APIDOC ## Rust: office2pdf::convert_with_options ### Description Converts a document using a custom configuration object for fine-grained control over the output. ### Parameters - **path** (string) - Required - The path to the source document. - **options** (ConvertOptions) - Required - Configuration object including paper_size, slide_range, sheet_names, landscape, pdf_standard, tagged, and font_paths. ### Response - **result** (struct) - Contains the generated PDF bytes and conversion metrics. ``` -------------------------------- ### ConvertOptions Structure for Document Conversion Source: https://context7.com/developer0hye/office2pdf/llms.txt Defines the full configuration options for document conversion in Rust, including filtering sheets/slides, PDF standards, paper size, font paths, orientation, and accessibility compliance. ```rust use office2pdf::config::{ConvertOptions, PaperSize, PdfStandard, SlideRange}; use std::path::PathBuf; let options = ConvertOptions { // Filter XLSX sheets by name (None = all sheets) sheet_names: Some(vec!["Sheet1".to_string(), "Data".to_string()]), // Filter PPTX slides by range (None = all slides) slide_range: Some(SlideRange::new(1, 10)), // PDF standard compliance (None = PDF 1.7) pdf_standard: Some(PdfStandard::PdfA2b), // Override paper size (None = source document size) paper_size: Some(PaperSize::A4), // Or custom dimensions in points: // paper_size: Some(PaperSize::Custom { width: 612.0, height: 792.0 }), // Additional font directories font_paths: vec![PathBuf::from("/fonts/custom")], // Force orientation (None = source orientation) landscape: Some(true), // true = landscape, false = portrait // Tagged PDF for accessibility tagged: true, // PDF/UA (Universal Accessibility) compliance pdf_ua: false, // Streaming mode for large XLSX files streaming: false, streaming_chunk_size: Some(1000), // rows per chunk }; ``` -------------------------------- ### Create Git Worktree Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Use git worktrees for all branch work to avoid using `git checkout`/`git switch` in the main repo. This command creates a new worktree for a specific branch. ```bash git worktree add ../- -b / ``` -------------------------------- ### Split PDF files in Rust Source: https://context7.com/developer0hye/office2pdf/llms.txt Splits a PDF into multiple parts based on defined page ranges using PageRange objects. ```rust use std::fs; use office2pdf::pdf_ops::{self, PageRange}; fn main() { let pdf_data = fs::read("document.pdf").expect("failed to read PDF"); // Define page ranges to extract (1-indexed, inclusive) let ranges = vec![ PageRange::new(1, 5), // Pages 1-5 PageRange::new(6, 10), // Pages 6-10 PageRange::parse("11-15").unwrap(), // Parse from string ]; // Split into separate PDFs let parts = pdf_ops::split(&pdf_data, &ranges).expect("failed to split PDF"); for (i, part) in parts.iter().enumerate() { let filename = format!("part_{}.pdf", i + 1); fs::write(&filename, part).expect("failed to write part"); println!("Wrote {}", filename); } } ``` -------------------------------- ### Streaming Conversion for Large XLSX Files Source: https://context7.com/developer0hye/office2pdf/llms.txt Process large XLSX files in chunks to manage memory usage effectively. This requires the `pdf-ops` feature to be enabled for PDF merging capabilities. ```rust use std::fs; use office2pdf::config::{ConvertOptions, Format}; fn main() { let large_xlsx = fs::read("large_report.xlsx").expect("failed to read file"); // Enable streaming mode for memory-efficient processing let options = ConvertOptions { streaming: true, streaming_chunk_size: Some(500), // Process 500 rows at a time ..Default::default() }; let result = office2pdf::convert_bytes(&large_xlsx, Format::Xlsx, &options).unwrap(); fs::write("large_report.pdf", &result.pdf).expect("failed to write PDF"); } ``` -------------------------------- ### Merge and Split PDF Files Source: https://context7.com/developer0hye/office2pdf/llms.txt Manipulates existing PDF files by merging multiple PDFs into one or splitting a PDF by specified page ranges. ```bash # Merge multiple PDFs into one office2pdf merge file1.pdf file2.pdf file3.pdf -o combined.pdf ``` ```bash # Split a PDF by page ranges office2pdf split document.pdf --pages 1-5,10-15 --outdir parts/ ``` -------------------------------- ### Edit Pull Request Description Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Rewrite the PR description if it is empty or unclear using `gh pr edit`. Include what changed, why, key changes, and relevant context. ```bash gh pr edit ``` -------------------------------- ### Merge PDF files in Rust Source: https://context7.com/developer0hye/office2pdf/llms.txt Combines multiple PDF byte arrays into a single document using the pdf_ops::merge function. ```rust use std::fs; use office2pdf::pdf_ops; fn main() { // Read multiple PDFs let pdf1 = fs::read("chapter1.pdf").expect("failed to read pdf1"); let pdf2 = fs::read("chapter2.pdf").expect("failed to read pdf2"); let pdf3 = fs::read("chapter3.pdf").expect("failed to read pdf3"); // Merge them into one let inputs: Vec<&[u8]> = vec![&pdf1, &pdf2, &pdf3]; let merged = pdf_ops::merge(&inputs).expect("failed to merge PDFs"); fs::write("complete_book.pdf", merged).expect("failed to write merged PDF"); println!("Merged 3 PDFs into complete_book.pdf"); } ``` -------------------------------- ### In-Memory Byte Conversion Source: https://context7.com/developer0hye/office2pdf/llms.txt Converts documents directly from raw bytes, suitable for WebAssembly or memory-resident data. ```APIDOC ## Rust: office2pdf::convert_bytes ### Description Converts raw document bytes to PDF. Useful for environments where files are not stored on the local filesystem. ### Parameters - **bytes** (&[u8]) - Required - The raw document content. - **format** (Format) - Required - The document format (e.g., Xlsx, Docx, Pptx). - **options** (ConvertOptions) - Required - Conversion configuration. ``` -------------------------------- ### Enable Streaming Mode for Large XLSX Files Source: https://context7.com/developer0hye/office2pdf/llms.txt Processes large XLSX files with bounded memory by enabling streaming mode. You can also customize the chunk size for rows processed per chunk. ```bash # Enable streaming mode office2pdf large_spreadsheet.xlsx --streaming ``` ```bash # Custom chunk size (rows per chunk) office2pdf large_spreadsheet.xlsx --streaming --streaming-chunk-size 500 ``` -------------------------------- ### Define Intermediate Representation (IR) structures in Rust Source: https://github.com/developer0hye/office2pdf/blob/main/PRD.md Defines the core data structures for documents, pages, and blocks used to normalize various input formats before rendering. ```rust pub struct Document { pub metadata: Metadata, pub pages: Vec, pub styles: StyleSheet, } pub enum Page { Flow(FlowPage), // DOCX: flowing text pages Fixed(FixedPage), // PPTX: fixed coordinate pages Table(TablePage), // XLSX: table-based pages } pub struct FlowPage { pub size: PageSize, pub margins: Margins, pub header: Option, pub footer: Option, pub content: Vec, } pub enum Block { Paragraph(Paragraph), Table(Table), Image(Image), PageBreak, List(List), } ``` -------------------------------- ### Streaming Mode for Large Files Source: https://context7.com/developer0hye/office2pdf/llms.txt Processes large files in chunks to maintain low memory usage. ```APIDOC ## Rust: office2pdf::convert_bytes (Streaming) ### Description Enables memory-efficient processing for large files by setting streaming options. ### Parameters - **options.streaming** (bool) - Required - Set to true to enable streaming. - **options.streaming_chunk_size** (Option) - Optional - Number of rows/elements to process per chunk. ``` -------------------------------- ### Check Pull Request Status Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Wait for CI to pass by watching the PR checks. Abort if tests fail. ```bash gh pr checks --watch ``` -------------------------------- ### Merge Pull Request Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Merge the pull request using the `--merge` flag. Never use `--delete-branch` as the worktree depends on the branch. ```bash gh pr merge --merge ``` -------------------------------- ### Delete Remote Branch Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Delete the remote branch from the origin repository. ```bash git push origin --delete ``` -------------------------------- ### Remove Git Worktree Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md After completing a task and returning to the main repo, remove the worktree associated with the completed branch. ```bash git worktree remove ../- ``` -------------------------------- ### Delete Local Branch Source: https://github.com/developer0hye/office2pdf/blob/main/CLAUDE.md Delete the local branch after removing the worktree and ensuring the work is complete. ```bash git branch -d ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.