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;
33mod border;
34mod destination;
35mod document;
36mod document_delegate;
37mod error;
38mod ffi;
39mod handle;
40mod notifications;
41mod outline;
42mod page;
43mod page_overlay_view;
44mod page_overlay_view_provider;
45mod selection;
46mod thumbnail_view;
47mod types;
48mod util;
49mod view;
50mod view_delegate;
51
52pub use accessibility_node::PdfAccessibilityNode;
53pub use action::{PdfAction, PdfActionLike};
54pub use action_goto::PdfActionGoTo;
55pub use action_named::PdfActionNamed;
56pub use action_remote_goto::PdfActionRemoteGoTo;
57pub use action_reset_form::PdfActionResetForm;
58pub use action_url::PdfActionUrl;
59pub use annotation::PdfAnnotation;
60pub use annotation_constants::{
61    PdfAnnotationHighlightingMode, PdfAnnotationKey, PdfAnnotationLineEndingStyle,
62    PdfAnnotationSubtype, PdfAnnotationTextIconName, PdfAnnotationWidgetSubtype,
63};
64pub use appearance_characteristics::PdfAppearanceCharacteristics;
65pub use border::PdfBorder;
66pub use destination::PdfDestination;
67pub use document::PdfDocument;
68pub use document_delegate::{PdfDocumentDelegate, PdfDocumentDelegateHandle};
69pub use error::{PdfKitError, Result};
70pub use notifications::{
71    PdfDocumentNotification, PdfDocumentNotificationUserInfoKey, PdfThumbnailViewNotification,
72    PdfViewNotification,
73};
74pub use outline::PdfOutline;
75pub use page::PdfPage;
76pub use page_overlay_view::PdfPageOverlayView;
77pub use page_overlay_view_provider::{
78    PdfPageOverlayViewProvider, PdfPageOverlayViewProviderHandle,
79};
80pub use selection::PdfSelection;
81pub use thumbnail_view::PdfThumbnailView;
82pub use types::{
83    DisplayBox, PdfActionNamedName, PdfAnnotationInfo, PdfAppearanceCharacteristicsInfo,
84    PdfAreaOfInterest, PdfBorderInfo, PdfBorderStyle, PdfColor, PdfDestinationInfo,
85    PdfDisplayDirection, PdfDisplayMode, PdfDocumentAttributes, PdfDocumentInfo,
86    PdfDocumentPermissions, PdfDocumentWriteOptions, PdfEdgeInsets, PdfInterpolationQuality,
87    PdfLineStyle, PdfMarkupType, PdfPageImageInitializationOptions, PdfPoint, PdfPrintScalingMode,
88    PdfRect, PdfSelectionGranularity, PdfSize, PdfTextAnnotationIconType, PdfTextRange,
89    PdfThumbnailLayoutMode, PdfThumbnailViewInfo, PdfViewInfo, PdfWidgetCellState,
90    PdfWidgetControlType,
91};
92pub use view::PdfView;
93pub use view_delegate::{PdfViewDelegate, PdfViewDelegateHandle};
94
95/// Re-exports the primary PDFKit wrapper types.
96pub mod prelude {
97    pub use crate::{
98        DisplayBox, PdfAccessibilityNode, PdfAction, PdfActionGoTo, PdfActionNamed,
99        PdfActionNamedName, PdfActionRemoteGoTo, PdfActionResetForm, PdfActionUrl, PdfAnnotation,
100        PdfAnnotationHighlightingMode, PdfAnnotationInfo, PdfAnnotationKey,
101        PdfAnnotationLineEndingStyle, PdfAnnotationSubtype, PdfAnnotationTextIconName,
102        PdfAnnotationWidgetSubtype, PdfAppearanceCharacteristics, PdfAppearanceCharacteristicsInfo,
103        PdfAreaOfInterest, PdfBorder, PdfBorderInfo, PdfBorderStyle, PdfColor, PdfDestination,
104        PdfDestinationInfo, PdfDisplayDirection, PdfDisplayMode, PdfDocument,
105        PdfDocumentAttributes, PdfDocumentDelegate, PdfDocumentDelegateHandle, PdfDocumentInfo,
106        PdfDocumentNotification, PdfDocumentNotificationUserInfoKey, PdfDocumentPermissions,
107        PdfDocumentWriteOptions, PdfEdgeInsets, PdfInterpolationQuality, PdfKitError, PdfLineStyle,
108        PdfMarkupType, PdfOutline, PdfPage, PdfPageImageInitializationOptions, PdfPageOverlayView,
109        PdfPageOverlayViewProvider, PdfPageOverlayViewProviderHandle, PdfPoint,
110        PdfPrintScalingMode, PdfRect, PdfSelection, PdfSelectionGranularity, PdfSize,
111        PdfTextAnnotationIconType, PdfTextRange, PdfThumbnailLayoutMode, PdfThumbnailView,
112        PdfThumbnailViewInfo, PdfThumbnailViewNotification, PdfView, PdfViewDelegate,
113        PdfViewDelegateHandle, PdfViewInfo, PdfViewNotification, PdfWidgetCellState,
114        PdfWidgetControlType, Result,
115    };
116}