Skip to content
Guides

Convert PDF to Word

Overview

Converting PDF to Word is an operation that converts the PDF format file into a editing Word format file. By converting PDF to Word, you can easily edit, modify, insert, or delete text and pictures, adjust layout and properties.

Layout differences

  • Word's Streaming Layout Ideal for editing, with your editing, the content dynamically adapts to different positions. However, a Word file would display differently due to the incompatibility of various software or app versions. It makes it unsuitable for precise documentation like electronic files or certificates.

  • PDF's Fixed Page Layout: Ensures a stable, uniform appearance and print quality across all devices. The content and formatting are locked upon creation, making alterations difficult without affecting the overall layout. It's preferred for formal documentation such as business reports and official electronic records.

Sample

This sample demonstrates how to convert from a PDF to DOCX file.

objective-c
// Get the path of the PDF file.
NSString *pdfPath = @"...";
// Get the path to the Word file.
NSString *outputPath = @"...";
CPDFConvertWordOptions *options = [[CPDFConvertWordOptions alloc] init];
// Set the OCR language, which takes effect only when IsAllowOCR is true.
[options setIsAllowOCR:YES];
// Whether to contain images when converting,which takes effect only when IsAllowOCR is false.
[options setIsContainImages:NO];
// Set whether to contain background images, which takes effect only when IsAllowOCR is true. 
[options setIsContainOCRBgImage:NO];
// Whether to contain annotations when converting.
[options setIsContainAnnotations:NO];
 // PDF to Word conversion parameter object (derived class of CPDFConvertOptions)Layout Options:CPDFConvertRetainPageLayout: Retain the same layout as your original file by splitting the text into multiple text boxes accoring to its layout.
[options setLayoutOptions:CPDFConvertRetainPageLayout];
// OCR language is English.
[options setLanguage:COCRLanguageEnglish];
CPDFConverterWord *converter = [[CPDFConverterWord alloc] initWithURL:[NSURL fileURLWithPath:pdfPath] password:nil];
[converter convertToFilePath:outputPath pageIndexs:nil options:options];