Make PdfContext
private again
This commit is contained in:
parent
8be482c2c2
commit
ccbe901cb7
@ -23,7 +23,7 @@ impl ExtGState {
|
||||
|
||||
/// Embed all used external graphics states into the PDF.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_external_graphics_states(ctx: &mut PdfContext) {
|
||||
pub(crate) fn write_external_graphics_states(ctx: &mut PdfContext) {
|
||||
for external_gs in ctx.extg_map.items() {
|
||||
let id = ctx.alloc.bump();
|
||||
ctx.ext_gs_refs.push(id);
|
||||
|
@ -22,7 +22,7 @@ const SYSTEM_INFO: SystemInfo = SystemInfo {
|
||||
|
||||
/// Embed all used fonts into the PDF.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_fonts(ctx: &mut PdfContext) {
|
||||
pub(crate) fn write_fonts(ctx: &mut PdfContext) {
|
||||
for font in ctx.font_map.items() {
|
||||
let type0_ref = ctx.alloc.bump();
|
||||
let cid_ref = ctx.alloc.bump();
|
||||
|
@ -32,7 +32,7 @@ pub struct PdfGradient {
|
||||
|
||||
/// Writes the actual gradients (shading patterns) to the PDF.
|
||||
/// This is performed once after writing all pages.
|
||||
pub fn write_gradients(ctx: &mut PdfContext) {
|
||||
pub(crate) fn write_gradients(ctx: &mut PdfContext) {
|
||||
for PdfGradient { transform, aspect_ratio, gradient, on_text } in
|
||||
ctx.gradient_map.items().cloned().collect::<Vec<_>>()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ use crate::{deflate, PdfContext};
|
||||
|
||||
/// Embed all used images into the PDF.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_images(ctx: &mut PdfContext) {
|
||||
pub(crate) fn write_images(ctx: &mut PdfContext) {
|
||||
for image in ctx.image_map.items() {
|
||||
// Add the primary image.
|
||||
match image.kind() {
|
||||
|
@ -61,7 +61,7 @@ pub fn pdf(
|
||||
}
|
||||
|
||||
/// Context for exporting a whole PDF document.
|
||||
pub struct PdfContext<'a> {
|
||||
struct PdfContext<'a> {
|
||||
/// The document that we're currently exporting.
|
||||
document: &'a Document,
|
||||
/// An introspector for the document, used to resolve locations links and
|
||||
|
@ -9,7 +9,7 @@ use crate::{AbsExt, PdfContext};
|
||||
|
||||
/// Construct the outline for the document.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_outline(ctx: &mut PdfContext) -> Option<Ref> {
|
||||
pub(crate) fn write_outline(ctx: &mut PdfContext) -> Option<Ref> {
|
||||
let mut tree: Vec<HeadingNode> = vec![];
|
||||
|
||||
// Stores the level of the topmost skipped ancestor of the next bookmarked
|
||||
|
@ -25,7 +25,7 @@ use crate::{deflate, AbsExt, EmExt, PdfContext};
|
||||
|
||||
/// Construct page objects.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn construct_pages(ctx: &mut PdfContext, frames: &[Frame]) {
|
||||
pub(crate) fn construct_pages(ctx: &mut PdfContext, frames: &[Frame]) {
|
||||
for frame in frames {
|
||||
construct_page(ctx, frame);
|
||||
}
|
||||
@ -33,7 +33,7 @@ pub fn construct_pages(ctx: &mut PdfContext, frames: &[Frame]) {
|
||||
|
||||
/// Construct a page object.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn construct_page(ctx: &mut PdfContext, frame: &Frame) {
|
||||
pub(crate) fn construct_page(ctx: &mut PdfContext, frame: &Frame) {
|
||||
let page_ref = ctx.alloc.bump();
|
||||
ctx.page_refs.push(page_ref);
|
||||
|
||||
@ -79,7 +79,7 @@ pub fn construct_page(ctx: &mut PdfContext, frame: &Frame) {
|
||||
|
||||
/// Write the page tree.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_page_tree(ctx: &mut PdfContext) {
|
||||
pub(crate) fn write_page_tree(ctx: &mut PdfContext) {
|
||||
for i in 0..ctx.pages.len() {
|
||||
write_page(ctx, i);
|
||||
}
|
||||
@ -194,7 +194,7 @@ fn write_page(ctx: &mut PdfContext, i: usize) {
|
||||
|
||||
/// Write the page labels.
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub fn write_page_labels(ctx: &mut PdfContext) -> Vec<(NonZeroUsize, Ref)> {
|
||||
pub(crate) fn write_page_labels(ctx: &mut PdfContext) -> Vec<(NonZeroUsize, Ref)> {
|
||||
let mut result = vec![];
|
||||
let mut prev: Option<&PdfPageLabel> = None;
|
||||
|
||||
@ -265,7 +265,7 @@ pub struct Page {
|
||||
|
||||
/// An exporter for the contents of a single PDF page.
|
||||
pub struct PageContext<'a, 'b> {
|
||||
pub parent: &'a mut PdfContext<'b>,
|
||||
pub(crate) parent: &'a mut PdfContext<'b>,
|
||||
page_ref: Ref,
|
||||
label: Option<PdfPageLabel>,
|
||||
pub content: Content,
|
||||
|
Loading…
x
Reference in New Issue
Block a user