Guides
Page Layout Mode
In certain formats, the page layout mode plays a key role in the quality of the converted document. ComPDFKit Conversion SDK supports two layout modes: Hybrid layout and Fixed layout.
- Hybrid layout: This layout uses paragraph indentations, columns, and tab positions to adjust the content. Its main advantage is flexibility; content can flow automatically as the document is edited, and it adapts to various screen sizes on different devices. This layout also supports structured maintenance and can implement consistent global formatting through style templates (e.g., titles, body text). Common use cases include documents that are frequently modified, such as reports, manuals, and dynamic tables.
- Fixed layout: Based on the PDF's "digital paper" model, this layout accurately positions every element (text, images, tables) on the page using a coordinate system (e.g., text is positioned 5 cm from the top and 3 cm from the left). The main advantage is high-precision rendering, which ensures consistency across different platforms. This layout is particularly useful for documents requiring precise reproduction, such as contracts, design drafts, and academic papers.
In the ComPDFKit Conversion SDK, page layout modes are commonly used in the following format conversions:
- PDF to Word
- PDF to HTML
Sample
This example demonstrates how to convert a PDF document to Word with Hybrid layout and Fixed layout:
objective-c
WordOptions *options = [[WordOptions alloc] init];
// Set Hybrid layout mode.
options.pageLayoutMode = PageLayoutModeFlow; // or PageLayoutModeBox
[CPDFConversion startPDFToWord:@"input.pdf" password:@"" outputPath:@"output.docx" options:options];