Skip to content

Crash when using pdfDocument.dataRepresentation() #1

@tangzzz-fan

Description

@tangzzz-fan

In code:
/// Set image here override open func draw(with box: PDFDisplayBox, in context: CGContext) { // Get the CGImage of our image guard let cgImage = self.image.cgImage else { return } // Draw our CGImage in the context of our PDFAnnotation bounds context.draw(cgImage, in: self.bounds) }
When I using pdfDocument.dataRepresentation() to save the pdf document, the app crashed: --> self.image == nil, the work thread is not main thread, maybe this is the reason, but I should not put save work item in main thread, all right?
Can you help me to figure it out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions