Skip to main content

parse_content_stream

Function parse_content_stream 

Source
pub fn parse_content_stream(input: &[u8]) -> Result<Group, PdfError>
Expand description

Parse a content-stream byte sequence into a single Group containing every shape painted by the stream. Nested q/Q brackets become nested Node::Group children. The returned root group has identity transform; per-q transforms live on the child groups.

gs operators are tolerated (operands dropped) since this entry point has no view of the page’s /Resources dictionary. Callers that have already resolved the page resources should use parse_content_stream_with_resources so a /GSx gs can apply the named graphics-state parameter dictionary’s entries to the current state per ISO 32000-1 §8.4.5.

Text-show operators (BT … Tj/TJ/'/'" … ET) are skipped silently; callers that need them should route through parse_content_stream_full with a resolved /Resources /Font dictionary attached.