-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I am exporting a PDF from HTML containing base encoded 64 images. Then doing so it takes a lot longer to export the document and I see the error "Networking process (0x124118190) took 4.373567 seconds to launch" multiple times in the console.
To Reproduce
I use the following HTML:
"""
<img
style="object-fit: cover; width: 250px; height: 190px; margin: 0 16px 16px 0"
src="data:image/png;base64,\(base64String)" width="300"
/>
"""An run the following code to export it:
@MainActor
public func createPDF(
fileName: String,
html: String
) async throws -> URL {
print("LOG: Start PDFRepository.createPDF")
@Dependency(\.pdf) var pdf
defer {
print("LOG: End PDFRepository.createPDF")
}
let fileURL = FileManager.default
.urls(for: .documentDirectory, in: .userDomainMask)[0]
.appendingPathComponent("\(fileName).pdf")
return try await withDependencies {
$0.pdf.render.configuration.paperSize = .a4
$0.pdf.render.configuration.paginationMode = .paginated
$0.pdf.render.configuration.concurrency = .automatic
$0.logger = .testValue
} operation: {
return try await pdf.render(html: html, to: fileURL)
}
}Expected behavior
The PDF to be exported quicker.
Actual behavior
It takes a lot of time for the PDF to export. The more images I add the longer it takes.
The goal here is to export images that are selected earlier by the user.
Environment:
- OS: iPadOS 16.1
- Xcode version: 16.0
- Swift version: 6.2
- swift-html-to-pdf version: 1.0.3
- Platform: iPad
Additional context
Add any other context about the problem here.
Error messages
GPU process (0x1240c01e0) took 1.811694 seconds to launch
WebContent process (0x12407c100) took 2.687557 seconds to launch
WebContent process (0x12407c640) took 4.369454 seconds to launch
WebContent process (0x12407cb80) took 4.352551 seconds to launch
Networking process (0x124118190) took 4.373567 seconds to launch
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working