danielsaidi / PrintingKit

PrintingKit is a Swift SDK that helps you print images, strings, views, PDFs etc. in Swift and SwiftUI.
MIT License
89 stars 11 forks source link

Printing via the string printItem causes string generation to be cut off a little after 1 page of text #6

Open dayglojago opened 1 month ago

dayglojago commented 1 month ago

Hello!

I'm using printingKit in a small SwiftUI macOS project (I am building to deploy to macOS 14 and later only) and have come across this issue running (admittedly) developer beta 1 of macOS 15.0 and using XCode 16 beta 1:

When I try to print a string, it just sort of cuts off at a certain point. Using the code:

Button(action: {
   try? printer.print(.string(processingJob.outputText))
}) {
HStack {
   Image(systemName: "printer.filled.and.paper")
      .foregroundColor(.gray)
   Text("Print Processed List")
   }
}                             

The printer itself is declared in the view just before the body:

let printer = Printer.shared
image

You can just see the text cuts off at the cards for Dominaria United, with the following remaining to print:

Wilds of Eldraine Commander:
1x - Colorless - Common - Near Mint - Wayfarer's Bauble

Born of the Gods:
1x - W - Uncommon - Near Mint - Glimpse the Sun God

Modern Masters 2015:
1x - B - Common - Lightly Played - Plagued Rusalka

Dominaria Remastered:
1x - W - Common - Near Mint - Remedy

Time Spiral Remastered:
1x - W - Uncommon - Near Mint - Celestial Crusader

Commander 2015:
1x - Colorless - Uncommon - Lightly Played - Tainted Field

Khans of Tarkir:
1x - W - Common - Lightly Played - Defiant Strike

Eternal Masters:
1x - W - Uncommon - Lightly Played - Field of Souls

Cards that could not be found:
1x - Sejiri Shelter // Sejiri Glacier - Zendikar Rising - Near Mint - Unknown Error
1x - Court of Grace (Extended Art) - Commander Legends - Near Mint - Unknown Error
1x - Storm of Souls - Innistrad: Crimson Vow Commander - Near Mint - Set Name Retrieval Failed
1x - Drogskol Reinforcements - Innistrad: Crimson Vow Commander - Near Mint - Set Name Retrieval Failed
1x - Tribute to Horobi // Echo of Death's Wail - Kamigawa: Neon Dynasty - Near Mint - Unknown Error
1x - Command Tower - Kamigawa: Neon Dynasty Commander - Near Mint - Set Name Retrieval Failed
1x - Grey Host Reinforcements - The Lord of the Rings: Tales of Middle-Earth Commander - Near Mint - Set Name Retrieval Failed"

Not sure if this is me, macOS 15.0 betas, Xcode betas, or something else! Would love some insight into how I could possibly fix this issue. Is there a limit to the length of strings one can pass in?

Full sample string that I am attempting to print:


Storm

Picklist Generation Time:
 2024-06-15 12:12:59

47 Total Cards:
-> 0 Mythics
-> 19 Rares
-> 21 Other Rarities
-> 7 Not Found

Mythics and Rares:
1x - W - Rare - Near Mint - Anafenza, Kin-Tree Spirit
1x - W - Rare - Lightly Played - Angel of Flight Alabaster
1x - W - Rare - Near Mint - Hanged Executioner
1x - W - Rare - Near Mint - Karmic Guide
1x - W - Rare - Near Mint - Mirror Entity
1x - W - Rare - Near Mint - Out of Time
1x - W - Rare - Near Mint - Oyobi, Who Split the Heavens
1x - W - Rare - Near Mint - Search for Glory
1x - W - Rare - Near Mint - Semester's End
1x - W - Rare - Near Mint - Spirit Bonds
1x - W - Rare - Near Mint - Tocasia's Welcome
1x - W - Rare - Near Mint - War of the Last Alliance
1x - B - Rare - Near Mint - Black Sun's Twilight
1x - B - Rare - Near Mint - Horobi, Death's Wail
1x - B - Rare - Near Mint - Pestilent Spirit
1x - Colorless - Rare - Lightly Played - Caves of Koilos
1x - Colorless - Rare - Near Mint - Exotic Orchard
1x - Colorless - Rare - Near Mint - Idol of Oblivion
1x - Colorless - Rare - Lightly Played - Temple of Silence

Commander Legends: Battle for Baldur's Gate:
1x - W - Uncommon - Near Mint - Beckoning Will-o'-Wisp
1x - W - Uncommon - Near Mint - Rescuer Chwinga
1x - Colorless - Uncommon - Near Mint - Mind Stone

Modern Masters 2017:
1x - W - Uncommon - Near Mint - Path to Exile
1x - Colorless - Uncommon - Near Mint - Orzhov Signet

Kamigawa: Neon Dynasty:
1x - W - Uncommon - Near Mint - Touch the Spirit Realm
1x - B - Uncommon - Near Mint - Gravelighter

The Lord of the Rings: Tales of Middle-Earth:
1x - B - Uncommon - Near Mint - Oath of the Grey Host
1x - Multicolor - Uncommon - Near Mint - Shadow Summoning

Commander Masters:
1x - Colorless - Common - Near Mint - Path of Ancestry

Commander Legends:
1x - Multicolor - Uncommon - Near Mint - Thalisse, Reverent Medium

Kaldheim:
1x - W - Uncommon - Near Mint - Clarion Spirit

Dominaria United:
1x - B - Uncommon - Near Mint - Cut Down

Wilds of Eldraine Commander:
1x - Colorless - Common - Near Mint - Wayfarer's Bauble

Born of the Gods:
1x - W - Uncommon - Near Mint - Glimpse the Sun God

Modern Masters 2015:
1x - B - Common - Lightly Played - Plagued Rusalka

Dominaria Remastered:
1x - W - Common - Near Mint - Remedy

Time Spiral Remastered:
1x - W - Uncommon - Near Mint - Celestial Crusader

Commander 2015:
1x - Colorless - Uncommon - Lightly Played - Tainted Field

Khans of Tarkir:
1x - W - Common - Lightly Played - Defiant Strike

Eternal Masters:
1x - W - Uncommon - Lightly Played - Field of Souls

Cards that could not be found:
1x - Sejiri Shelter // Sejiri Glacier - Zendikar Rising - Near Mint - Unknown Error
1x - Court of Grace (Extended Art) - Commander Legends - Near Mint - Unknown Error
1x - Storm of Souls - Innistrad: Crimson Vow Commander - Near Mint - Set Name Retrieval Failed
1x - Drogskol Reinforcements - Innistrad: Crimson Vow Commander - Near Mint - Set Name Retrieval Failed
1x - Tribute to Horobi // Echo of Death's Wail - Kamigawa: Neon Dynasty - Near Mint - Unknown Error
1x - Command Tower - Kamigawa: Neon Dynasty Commander - Near Mint - Set Name Retrieval Failed
1x - Grey Host Reinforcements - The Lord of the Rings: Tales of Middle-Earth Commander - Near Mint - Set Name Retrieval Failed```
danielsaidi commented 1 month ago

Hi @dayglojago

Thank you for the detailed bug report.

Yeah, the first set of betas are a pretty rough time to start fixing bugs, but let's keep an eye on this.

Do you know if this worked in macOS 14?

dayglojago commented 1 month ago

I just checked and it does work on macOS 14. That kinda solves my issue, but it's good to know this is an issue in macOS 15!

Thanks

danielsaidi commented 1 month ago

Oh, that's great! But let's keep an eye on it 👍