Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Messages(private val binding : FlutterPlugin.FlutterPluginBinding,

// background thread render
val pageImage = page.render(
tempOutFile, width, height, color, format, crop, cropX, cropY, cropW, cropH, quality
tempOutFile, width, height, color, format, crop, cropX, cropY, cropW, cropH, quality, forPrint = false
)

withContext(Dispatchers.Main) {
Expand Down
4 changes: 2 additions & 2 deletions packages/pdfx/ios/Classes/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class Page {
var success = false
var transform = renderer.getDrawingTransform(.mediaBox, rect: CGRect(origin: CGPoint.zero, size: bitmapSize), rotate: 0, preserveAspectRatio: true)
let compressionQuality = CGFloat(quality) / 100
tempData.withUnsafeMutableBytes { (ptr) in
let rawPtr = ptr.baseAddress
tempData.withUnsafeMutableBytes { (ptr: UnsafeMutableRawBufferPointer) in
guard let rawPtr = ptr.baseAddress else { return }
let rgb = CGColorSpaceCreateDeviceRGB()
let context = CGContext(data: rawPtr, width: Int(bitmapSize.width), height: Int(bitmapSize.height), bitsPerComponent: 8, bytesPerRow: stride, space: rgb, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)
if context != nil {
Expand Down
3 changes: 2 additions & 1 deletion packages/pdfx/ios/Classes/Hooks.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import UIKit

extension NSColor {
extension UIColor {
convenience init(hexString: String) {
let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = UInt64()
Expand Down