// MicroPDF - MuPDF API Compatible C Header
// Auto-generated from Rust FFI - DO NOT EDIT MANUALLY
// Module: cpdf

#ifndef MUPDF_FITZ_CPDF_H
#define MUPDF_FITZ_CPDF_H

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

// ============================================================================
// Cpdf Functions (102 total)
// ============================================================================

int32_t cpdf_OCGCoalesce(int32_t doc);
u8 * cpdf_OCGList(int32_t doc, size_t * len_out);
int32_t cpdf_OCGOrderAll(int32_t doc);
int32_t cpdf_OCGRename(int32_t doc, const char * from, const char * to);
int32_t cpdf_addBookmark(int32_t doc, int level, int page, const char * title, int is_open);
int32_t cpdf_addBookmarkTitle(int32_t doc, const char * title);
int32_t cpdf_addPageLabels(int32_t doc, int start_page, int style, const char * prefix, int start_value);
int32_t cpdf_addPageNumbers(int32_t doc, int32_t range_h, const char * format, int position_code, double position_arg, double font_size, int font_code, double r, double g, double b, int start_value);
int32_t cpdf_addRectangle(int32_t doc, int32_t range_h, double x, double y, double w, double h, double r, double g, double b, int outline, double linewidth, double opacity);
int32_t cpdf_addText(int32_t doc, int32_t range_h, const char * text, int position_code, double position_arg, double linespacing, double font_size, int font_code, double r, double g, double b, int underneath, double opacity, int justification_code);
int32_t cpdf_addWatermarkText(int32_t doc, const char * text, int font_code, double font_size, double r, double g, double b, double opacity, double angle_deg);
int32_t cpdf_all(int32_t doc_handle);
int32_t cpdf_attachFile(int32_t doc, const char * path);
int32_t cpdf_blankDocument(double width, double height, int num_pages);
int32_t cpdf_bookmarksOpenToLevel(int32_t doc, int level);
int32_t cpdf_chop(int32_t doc, int32_t range, int x_pieces, int y_pieces, int columns, int btt, int rtl);
int32_t cpdf_chopHV(int32_t doc, int32_t range, int is_h, double line);
void cpdf_clearError(void);
int32_t cpdf_combinePages(int32_t under, int32_t over, int scale_to_fit, int swap);
int32_t cpdf_compress(int32_t doc);
int32_t cpdf_copyBox(int32_t doc, int32_t range, const char * from_name, const char * to_name);
int32_t cpdf_crop(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_decompress(int32_t doc);
int32_t cpdf_decrypt(int32_t doc, const char * password);
int32_t cpdf_decryptIfNeeded(int32_t doc, const char * password);
void cpdf_deletePdf(int32_t handle);
void cpdf_deleteRange(int32_t handle);
int cpdf_dumpAttachments(int32_t doc, const char * output_dir);
int32_t cpdf_encrypt(int32_t doc, int method_code, const char * user_pw, const char * owner_pw, uint32_t perms_bits);
int cpdf_encrypted(int32_t doc);
int32_t cpdf_even(int32_t doc_handle);
int cpdf_extractImages(int32_t doc, int32_t range_h, const char * output_dir);
void cpdf_free(u8 * ptr, int len);
void cpdf_freeHandleArray(int32_t * ptr, int count);
void cpdf_freeString(char * ptr);
int32_t cpdf_fromFile(const char * path, const char * _password);
int32_t cpdf_fromMemory(u8 const * data, int len);
u8 * cpdf_getAnnotationsJSON(int32_t doc, int32_t range_h, size_t * len_out);
u8 * cpdf_getBookmarksJSON(int32_t doc, size_t * len_out);
u8 * cpdf_getImageListJSON(int32_t doc, int32_t range_h, size_t * len_out);
char * cpdf_getInfo(int32_t doc, const char * key);
u8 * cpdf_getPageLabelsJSON(int32_t doc, size_t * len_out);
char * cpdf_getPageLayout(int32_t doc);
char * cpdf_getPageMode(int32_t doc);
char * cpdf_getPageText(int32_t doc, int page_num);
char * cpdf_getText(int32_t doc, int32_t range_h);
u8 * cpdf_getXMP(int32_t doc, size_t * len_out);
int32_t cpdf_hardBox(int32_t doc, int32_t range, const char * box_name);
int cpdf_hasPermission(int32_t doc, const char * password, uint32_t perm_bit);
int32_t cpdf_hflip(int32_t doc, int32_t range);
u8 * cpdf_imageResolutionJSON(int32_t doc, int32_t range_h, double min_dpi, size_t * len_out);
int cpdf_lastError(void);
const char * cpdf_lastErrorString(void);
u8 * cpdf_listAttachmentsJSON(int32_t doc, size_t * len_out);
u8 * cpdf_listFontsJSON(int32_t doc, int32_t range_h, size_t * len_out);
int32_t cpdf_mergeSimple(int32_t const * handles, int num);
u8 * cpdf_missingFontsJSON(int32_t doc, int32_t range_h, size_t * len_out);
int32_t cpdf_odd(int32_t doc_handle);
int cpdf_pages(int32_t handle);
int32_t cpdf_parsePagespec(int32_t doc_handle, const char * spec);
int32_t cpdf_range(int start, int end);
int32_t cpdf_removeAnnotations(int32_t doc, int32_t range_h);
int32_t cpdf_removeAttachments(int32_t doc);
int32_t cpdf_removeBleedBox(int32_t doc, int32_t range);
int32_t cpdf_removeBookmarks(int32_t doc);
int32_t cpdf_removeCropBox(int32_t doc, int32_t range);
int32_t cpdf_removeFonts(int32_t doc);
int32_t cpdf_removeInfo(int32_t doc);
int32_t cpdf_removePageLabels(int32_t doc);
int32_t cpdf_removeText(int32_t doc, int32_t range_h);
int32_t cpdf_removeTrimBox(int32_t doc, int32_t range);
int32_t cpdf_removeXMP(int32_t doc);
int32_t cpdf_rotate(int32_t doc, int32_t range, int degrees);
int32_t cpdf_rotateBy(int32_t doc, int32_t range, int degrees);
int32_t cpdf_rotateContents(int32_t doc, int32_t range, double angle);
int32_t cpdf_scale(int32_t doc, int32_t range, double sx, double sy);
int32_t cpdf_scaleToFit(int32_t doc, int32_t range, double w, double h, double scale_factor);
int32_t cpdf_scaleToFitPaper(int32_t doc, int32_t range, int papersize_code);
int32_t cpdf_setArtBox(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_setBleedBox(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_setBookmarksJSON(int32_t doc, u8 const * data, size_t len);
int32_t cpdf_setCropBox(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_setInfo(int32_t doc, const char * key, const char * value);
int32_t cpdf_setMediaBox(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_setPDFVersion(int32_t doc, int major, int minor);
int32_t cpdf_setPageLayout(int32_t doc, const char * layout);
int32_t cpdf_setPageMode(int32_t doc, const char * mode);
int32_t cpdf_setTrimBox(int32_t doc, int32_t range, double x, double y, double w, double h);
int32_t cpdf_setXMP(int32_t doc, u8 const * data, size_t len);
int32_t cpdf_shift(int32_t doc, int32_t range, double dx, double dy);
int32_t * cpdf_splitByRange(int32_t doc_handle, int32_t const * range_handles, int num_ranges, int * out_count);
int32_t cpdf_squeeze(int32_t doc);
int32_t cpdf_stampOn(int32_t over, int32_t under, int32_t range_h, int scale_to_fit);
int32_t cpdf_stampUnder(int32_t under, int32_t over, int32_t range_h, int scale_to_fit);
int32_t cpdf_stretch(int32_t doc, int32_t range, double w, double h);
int cpdf_toFile(int32_t handle, const char * path, int _linearize, int _make_id);
u8 * cpdf_toMemory(int32_t handle, int _linearize, int _make_id, int * len_out);
int32_t cpdf_twoUp(int32_t doc);
int32_t cpdf_twoUpStack(int32_t doc);
int32_t cpdf_upright(int32_t doc, int32_t range);
char * cpdf_version(int32_t handle);
int32_t cpdf_vflip(int32_t doc, int32_t range);

#ifdef __cplusplus
}
#endif

#endif /* MUPDF_FITZ_CPDF_H */
