Skip to main content

pdfkit/
lib.rs

1#![doc = include_str!("../README.md")]
2//!
3//! ---
4//!
5//! # API Documentation
6//!
7//! Safe Rust bindings for Apple's [PDFKit](https://developer.apple.com/documentation/pdfkit)
8//! framework on macOS.
9
10#![cfg_attr(docsrs, feature(doc_cfg))]
11#![allow(
12    clippy::cast_possible_truncation,
13    clippy::doc_markdown,
14    clippy::missing_const_for_fn,
15    clippy::missing_errors_doc,
16    clippy::module_name_repetitions,
17    clippy::must_use_candidate,
18    clippy::redundant_pub_crate,
19    clippy::return_self_not_must_use,
20    clippy::struct_excessive_bools
21)]
22
23mod accessibility_node;
24mod action;
25mod action_goto;
26mod action_named;
27mod action_remote_goto;
28mod action_reset_form;
29mod action_url;
30mod annotation;
31mod annotation_constants;
32mod appearance_characteristics;
33#[cfg(feature = "async")]
34#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
35pub mod async_api;
36mod border;
37mod destination;
38mod document;
39mod document_delegate;
40mod error;
41mod ffi;
42mod handle;
43mod notifications;
44mod outline;
45mod page;
46mod page_overlay_view;
47mod page_overlay_view_provider;
48mod selection;
49mod thumbnail_view;
50mod types;
51mod util;
52mod view;
53mod view_delegate;
54
55pub use accessibility_node::PdfAccessibilityNode;
56pub use action::{PdfAction, PdfActionLike};
57pub use action_goto::PdfActionGoTo;
58pub use action_named::PdfActionNamed;
59pub use action_remote_goto::PdfActionRemoteGoTo;
60pub use action_reset_form::PdfActionResetForm;
61pub use action_url::PdfActionUrl;
62pub use annotation::PdfAnnotation;
63pub use annotation_constants::{
64    PdfAnnotationHighlightingMode, PdfAnnotationKey, PdfAnnotationLineEndingStyle,
65    PdfAnnotationSubtype, PdfAnnotationTextIconName, PdfAnnotationWidgetSubtype,
66};
67pub use appearance_characteristics::PdfAppearanceCharacteristics;
68#[cfg(feature = "async")]
69pub use async_api::{
70    PdfDocumentFindEvent, PdfDocumentFindMatch, PdfDocumentFindOptions, PdfDocumentFindPageMatch,
71    PdfDocumentFindStream,
72};
73pub use border::PdfBorder;
74pub use destination::PdfDestination;
75pub use document::PdfDocument;
76pub use document_delegate::{PdfDocumentDelegate, PdfDocumentDelegateHandle};
77pub use error::{PdfKitError, Result};
78pub use notifications::{
79    PdfDocumentNotification, PdfDocumentNotificationUserInfoKey, PdfThumbnailViewNotification,
80    PdfViewNotification,
81};
82pub use outline::PdfOutline;
83pub use page::PdfPage;
84pub use page_overlay_view::PdfPageOverlayView;
85pub use page_overlay_view_provider::{
86    PdfPageOverlayViewProvider, PdfPageOverlayViewProviderHandle,
87};
88pub use selection::PdfSelection;
89pub use thumbnail_view::PdfThumbnailView;
90pub use types::{
91    DisplayBox, PdfActionNamedName, PdfAnnotationInfo, PdfAppearanceCharacteristicsInfo,
92    PdfAreaOfInterest, PdfBorderInfo, PdfBorderStyle, PdfColor, PdfDestinationInfo,
93    PdfDisplayDirection, PdfDisplayMode, PdfDocumentAttributes, PdfDocumentInfo,
94    PdfDocumentPermissions, PdfDocumentWriteOptions, PdfEdgeInsets, PdfInterpolationQuality,
95    PdfLineStyle, PdfMarkupType, PdfPageImageInitializationOptions, PdfPoint, PdfPrintScalingMode,
96    PdfRect, PdfSelectionGranularity, PdfSize, PdfTextAnnotationIconType, PdfTextRange,
97    PdfThumbnailLayoutMode, PdfThumbnailViewInfo, PdfViewInfo, PdfWidgetCellState,
98    PdfWidgetControlType,
99};
100pub use view::PdfView;
101pub use view_delegate::{PdfViewDelegate, PdfViewDelegateHandle};
102
103/// Re-exports the primary PDFKit wrapper types.
104pub mod prelude {
105    pub use crate::{
106        DisplayBox, PdfAccessibilityNode, PdfAction, PdfActionGoTo, PdfActionNamed,
107        PdfActionNamedName, PdfActionRemoteGoTo, PdfActionResetForm, PdfActionUrl, PdfAnnotation,
108        PdfAnnotationHighlightingMode, PdfAnnotationInfo, PdfAnnotationKey,
109        PdfAnnotationLineEndingStyle, PdfAnnotationSubtype, PdfAnnotationTextIconName,
110        PdfAnnotationWidgetSubtype, PdfAppearanceCharacteristics, PdfAppearanceCharacteristicsInfo,
111        PdfAreaOfInterest, PdfBorder, PdfBorderInfo, PdfBorderStyle, PdfColor, PdfDestination,
112        PdfDestinationInfo, PdfDisplayDirection, PdfDisplayMode, PdfDocument,
113        PdfDocumentAttributes, PdfDocumentDelegate, PdfDocumentDelegateHandle, PdfDocumentInfo,
114        PdfDocumentNotification, PdfDocumentNotificationUserInfoKey, PdfDocumentPermissions,
115        PdfDocumentWriteOptions, PdfEdgeInsets, PdfInterpolationQuality, PdfKitError, PdfLineStyle,
116        PdfMarkupType, PdfOutline, PdfPage, PdfPageImageInitializationOptions, PdfPageOverlayView,
117        PdfPageOverlayViewProvider, PdfPageOverlayViewProviderHandle, PdfPoint,
118        PdfPrintScalingMode, PdfRect, PdfSelection, PdfSelectionGranularity, PdfSize,
119        PdfTextAnnotationIconType, PdfTextRange, PdfThumbnailLayoutMode, PdfThumbnailView,
120        PdfThumbnailViewInfo, PdfThumbnailViewNotification, PdfView, PdfViewDelegate,
121        PdfViewDelegateHandle, PdfViewInfo, PdfViewNotification, PdfWidgetCellState,
122        PdfWidgetControlType, Result,
123    };
124    #[cfg(feature = "async")]
125    pub use crate::{
126        PdfDocumentFindEvent, PdfDocumentFindMatch, PdfDocumentFindOptions,
127        PdfDocumentFindPageMatch, PdfDocumentFindStream,
128    };
129}