Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/pdf-canvas/src/canvas_graphics_state_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ impl<B: CanvasBackend> GraphicsStateOps for PdfCanvas<'_, B> {
.resources
.ok_or(PdfCanvasError::MissingPageResources)?;

let states = resources
.external_graphics_state(dict_name)
.ok_or_else(|| PdfCanvasError::GraphicsStateNotFound(dict_name.to_string()))?;
let Some(states) = resources.external_graphics_state(dict_name) else {
// If the specified `ExtGState` is not found, the ignored parameters should not cause an error.
return Ok(());
};

for state in &states.params {
match state {
Expand Down
2 changes: 0 additions & 2 deletions crates/pdf-canvas/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pub enum PdfCanvasError {
ColorSpaceNotFound(String),
#[error("Pattern '{0}' not found")]
PatternNotFound(String),
#[error("Graphics state dictionary '{0}' not found in resources")]
GraphicsStateNotFound(String),
#[error("Font '{0}' is a Type3 font but is missing its definition data")]
MissingType3FontData(String),
#[error(
Expand Down
Loading