Knowledge Base - Pdf linearization management

With setOpenFlag you can modify a flag affecting how pdf pages are loaded.

PDFIOS.h (iOS):

void Document_setOpenFlag(int flag);

Document.java (Android)

Document.SetOpenFlag(int flag)

There are 3 possible options:

0: Ignore linearized PDF, always load pages from normal corss reference table. 

1: Load linearized header and read all pages object to record page size. (default behaviour)

3: Load linearized header, but only read first page and record other pages size same to first page.

The flag is a global setting, which effects all Document.OpenXXX() methods.

iOS:

PDFDoc *doc = [[PDFDoc alloc] init];

Document_setOpenFlag(3);

int error = [doc openStream:httpStream :@""];

Android:

m_doc = new Document();
Document.SetOpenFlag(3);
int ret = m_doc.OpenStream(m_http_stream, pdf_pswd); 


With getLinearizedOption you can check linearized pdf status.

PDFIOS.h (iOS):

int Document_getLinearizedStatus(PDF_DOC doc);

There are 4 possible options:

0: Linearized header not loaded or no linearized header. (setOpenFlag(0) cause always return 0)

1: There is linearized header, but linearized entry checked as failed.

2: There is linearized header, linearized entry checked succeeded, but hint table is damaged.

3: Linearized header loaded succeeded.

iOS:

int status = [doc getLinearizedStatus]; 

Android:

int status = doc.getLinearizedStatus(); 

Applies To

RadaeePDF SDK for Android, RadaeePDF SDK for iOS

Details

Created : 2020-08-18 14:26:05, Last Modified : 2020-08-20 14:44:18