NativeElixirPdfUtilities.Limits (native_elixir_pdf_utilities v1.1.0)

View Source

Runtime resource limits used by PDF parsing, information access, text extraction, merging, page transforms, splitting, and HTML-to-PDF rendering.

HTML/PDF link clipping uses :max_clip_projection_work for contour subdivision and planar arrangement work. :clip_curve_precision is the reciprocal of the maximum curve-to-chord deviation in PDF points. :max_clip_expression_depth bounds nested geometric clip intersections independently of drawing-group nesting.

Applications can override individual defaults in config/config.exs or config/runtime.exs:

config :native_elixir_pdf_utilities,
  limits: [
    max_svg_bytes: 10_000_000,
    max_svg_raster_dimension: 16_284
  ]

Configuration is validated when the library application starts. Values are application-wide, and changing them requires restarting the application. Document operations default to a five-minute deadline and a 1 GiB observed BEAM worker-memory allowance. Native allocations are outside that allowance; see the resource limits guide for enforcement boundaries.

Summary

Types

A configurable resource-limit name.

t()

The complete validated resource-limit configuration.

Functions

Returns the library's built-in resource limits.

Returns the effective resource limits loaded for this application instance.

Types

key()

@type key() ::
  :max_operation_timeout_ms
  | :max_operation_memory_bytes
  | :operation_memory_check_interval_ms
  | :max_pdf_attachments
  | :max_aggregate_html_source_bytes
  | :max_aggregate_css_source_bytes
  | :max_html_source_bytes
  | :max_css_source_bytes
  | :max_responsive_image_candidates
  | :max_html_nodes
  | :max_html_depth
  | :max_embedded_documents
  | :max_embedded_document_depth
  | :max_frameset_tracks
  | :max_frameset_cells
  | :max_html_tree_work
  | :max_text_decoration_layers
  | :max_html_numeric_token_bytes
  | :max_css_rules
  | :max_media_query_depth
  | :max_css_calculation_depth
  | :max_css_work
  | :max_layout_boxes
  | :max_drawing_group_depth
  | :max_rendered_text_bytes
  | :max_layout_text_work
  | :max_layout_measurement_cache_bytes
  | :max_layout_measurement_cache_entries
  | :max_table_grid_work
  | :max_layout_line_work
  | :max_grid_occupied_cells
  | :max_grid_tracks
  | :max_grid_placement_work
  | :max_table_model_work
  | :max_table_header_work
  | :max_rendered_pages
  | :max_rendered_pdf_bytes
  | :max_font_source_bytes
  | :max_aggregate_font_source_bytes
  | :max_font_count
  | :max_font_candidates
  | :max_font_discoveries
  | :max_font_cache_bytes
  | :max_system_font_cache_bytes
  | :max_pdf_attachment_bytes
  | :max_pdf_attachment_total_bytes
  | :max_mime_container_bytes
  | :max_mime_container_entries
  | :max_appearance_text_bytes
  | :max_appearance_widgets
  | :max_pdf_form_fields
  | :max_pdf_form_depth
  | :max_pdf_form_text_bytes
  | :max_pdf_form_metadata_bytes
  | :max_pdf_form_preparation_entries
  | :max_pdf_form_font_uses
  | :max_pdf_form_font_work_bytes
  | :max_aggregate_svg_source_bytes
  | :max_aggregate_svg_nodes
  | :max_aggregate_svg_path_bytes
  | :max_aggregate_svg_filter_primitives
  | :max_aggregate_svg_references
  | :max_svg_expansion_work
  | :max_svg_expanded_path_bytes
  | :max_svg_font_work_bytes
  | :max_svg_resource_bytes
  | :max_aggregate_svg_resource_bytes
  | :max_svg_nodes
  | :max_css_transform_operations
  | :max_clip_projection_work
  | :max_clip_expression_depth
  | :clip_curve_precision
  | :svg_raster_scale
  | :max_svg_depth
  | :max_svg_path_bytes
  | :max_svg_filter_primitives
  | :max_svg_turbulence_octaves
  | :max_svg_filter_work
  | :max_svg_references
  | :max_svg_output_bytes
  | :max_svg_bytes
  | :max_svg_raster_dimension
  | :max_aggregate_svg_raster_pixels
  | :max_aggregate_svg_surface_pixels
  | :max_svg_raster_pixels
  | :max_png_working_bytes
  | :max_image_count
  | :max_image_source_bytes
  | :max_aggregate_image_source_bytes
  | :max_decoded_image_bytes
  | :max_aggregate_decoded_image_bytes
  | :max_background_image_tiles
  | :max_layout_cardinality
  | :max_css_variable_bytes
  | :max_css_variable_total_bytes
  | :max_css_variable_work
  | :max_css_variable_depth
  | :max_css_numeric_magnitude
  | :max_pdf_reader_decoded_bytes
  | :max_pdf_reader_tokens
  | :max_pdf_reader_values
  | :max_pdf_reader_work
  | :max_pdf_predictor_working_bytes
  | :max_pdf_container_entries
  | :max_pdf_numeric_token_bytes
  | :max_pdf_input_bytes
  | :max_pdf_numeric_magnitude
  | :max_pdf_objects
  | :max_pdf_object_stream_entries
  | :max_pdf_pages
  | :max_pdf_page_tree_depth
  | :max_pdf_reference_chain_depth
  | :max_pdf_reference_resolution_work
  | :max_pdf_value_depth
  | :max_pdf_decoded_stream_bytes
  | :max_pdf_decompression_ratio
  | :max_pdf_xref_length_candidates
  | :max_pdf_xref_revisions
  | :max_pdf_info_value_bytes
  | :max_pdf_info_total_bytes
  | :max_pdf_outline_items
  | :max_pdf_outline_depth
  | :max_pdf_outline_title_bytes
  | :max_pdf_outline_total_title_bytes
  | :max_pdf_name_tree_nodes
  | :max_pdf_named_destinations
  | :max_stamp_text_bytes
  | :max_stamp_decoded_content_bytes
  | :max_merge_inputs
  | :max_assembled_pdf_bytes
  | :max_aggregate_merge_input_bytes
  | :max_merged_objects
  | :max_merged_pages
  | :max_split_outputs
  | :max_split_object_writes
  | :max_aggregate_split_output_bytes
  | :max_extracted_text_bytes
  | :max_cmap_expanded_bytes
  | :max_text_decoded_content_bytes
  | :max_text_parsed_instructions
  | :max_text_parsed_tokens
  | :max_text_parsed_values
  | :max_text_font_work
  | :max_text_stream_uses
  | :max_text_instruction_uses
  | :max_text_form_expansions
  | :max_text_spans
  | :max_text_marked_content_depth
  | :max_text_layout_whitespace_bytes
  | :max_cmap_work
  | :max_cmap_bytes
  | :max_cmap_entries
  | :max_cid_width_entries
  | :max_form_xobject_depth
  | :max_font_kerning_pairs
  | :max_font_cmap_work
  | :max_font_math_work
  | :max_font_name_bytes
  | :max_font_subset_work
  | :max_font_subset_bytes
  | :max_font_subset_checksum_work
  | :max_font_cache_entries
  | :max_system_font_cache_entries
  | :max_html_form_value_bytes
  | :max_html_form_value_memory_bytes
  | :max_html_form_value_timeout_ms
  | :max_html_pattern_bytes
  | :max_html_pattern_compile_work
  | :max_html_pattern_depth
  | :max_html_pattern_match_work
  | :max_html_pattern_values
  | :max_image_map_coordinates
  | :max_image_map_geometry_work

A configurable resource-limit name.

t()

@type t() :: %{required(key()) => pos_integer()}

The complete validated resource-limit configuration.

Functions

defaults()

@spec defaults() :: t()

Returns the library's built-in resource limits.

effective()

@spec effective() :: t()

Returns the effective resource limits loaded for this application instance.