Vanilla.PDF  1.6.0
Cross-platform toolkit for creating and modifying PDF documents
Enumerate xref
error_type process_file(FileHandle* file, int nested) {
XrefChainHandle* chain = NULL;
XrefChainIteratorHandle* chain_iterator = NULL;
RETURN_ERROR_IF_NOT_SUCCESS(File_XrefChain(file, &chain));
RETURN_ERROR_IF_NOT_SUCCESS(XrefChain_GetIterator(chain, &chain_iterator));
while (VANILLAPDF_ERROR_SUCCESS == XrefChainIterator_IsValid(chain_iterator, &valid)
&& VANILLAPDF_RV_TRUE == valid) {
XrefHandle* xref = NULL;
RETURN_ERROR_IF_NOT_SUCCESS(XrefChainIterator_GetValue(chain_iterator, &xref));
RETURN_ERROR_IF_NOT_SUCCESS(process_xref(xref, nested));
RETURN_ERROR_IF_NOT_SUCCESS(Xref_Release(xref));
RETURN_ERROR_IF_NOT_SUCCESS(XrefChainIterator_Next(chain_iterator));
}
RETURN_ERROR_IF_NOT_SUCCESS(XrefChainIterator_Release(chain_iterator));
RETURN_ERROR_IF_NOT_SUCCESS(XrefChain_Release(chain));
return VANILLAPDF_TEST_ERROR_SUCCESS;
}
Represents low-level file access handle.
error_type CALLING_CONVENTION File_XrefChain(FileHandle *handle, XrefChainHandle **result)
Get chain of xref tables for iteration.
An ordered collection of all XrefHandle within the PDF file.
error_type CALLING_CONVENTION XrefChain_GetIterator(XrefChainHandle *handle, XrefChainIteratorHandle **result)
Get cross-reference section iterator.
error_type CALLING_CONVENTION XrefChain_Release(XrefChainHandle *handle)
Decrement the internal reference counter.
A pointer to XrefHandle within XrefChainHandle collection.
error_type CALLING_CONVENTION XrefChainIterator_IsValid(XrefChainIteratorHandle *handle, boolean_type *result)
Determine if the current iterator position is valid.
error_type CALLING_CONVENTION XrefChainIterator_Next(XrefChainIteratorHandle *handle)
Advance iterator to the next position.
error_type CALLING_CONVENTION XrefChainIterator_Release(XrefChainIteratorHandle *handle)
Decrement the internal reference counter.
error_type CALLING_CONVENTION XrefChainIterator_GetValue(XrefChainIteratorHandle *handle, XrefHandle **result)
Get cross-reference section from current iterator position.
The cross-reference table contains information that permits random access to indirect objects within ...
error_type CALLING_CONVENTION Xref_Release(XrefHandle *handle)
Decrement the internal reference counter.
const boolean_type VANILLAPDF_RV_TRUE
Represents the boolean true value.
const boolean_type VANILLAPDF_RV_FALSE
Represents the boolean false value.
const error_type VANILLAPDF_ERROR_SUCCESS
Indicates that the operation completed successfully.
uint32_t error_type
This is return value type of all API functions.
Definition: c_types.h:25
int8_t boolean_type
Boolean type supported in C.
Definition: c_types.h:31