Skip to content

gh-286 Rework TeddyStudio printing to generate browser-independent PDFs - #351

Open
henryk86 wants to merge 37 commits into
toniebox-reverse-engineering:developfrom
henryk86:feature/reworkTeddyStudioPrint
Open

henryk86 wants to merge 37 commits into
toniebox-reverse-engineering:developfrom
henryk86:feature/reworkTeddyStudioPrint

Conversation

@henryk86

@henryk86 henryk86 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

This PR reworks the TeddyStudio print workflow to no longer depend on browser-specific CSS print support.

Previously, label printing relied on CSS print properties such as page margins and print layout handling, which currently only work reliably in Chrome. The new implementation generates the final print output as a PDF directly in the frontend instead.

Changes

  • Generate TeddyStudio labels as a PDF with fixed physical dimensions instead of relying on CSS print layouts
  • Remove the dependency on browser-specific @page / print margin handling
  • Keep the existing TeddyStudio label functionality, including:
    • label sizes and spacing
    • round and square labels
    • image, text and combined layouts
    • track lists
    • bleed and borders
    • image scaling and positioning
    • circular text
    • language/flag and model information
    • custom fonts
    • local label overrides
    • multi-page output
  • Add a dedicated Download PDF action
  • Open the generated PDF only after PDF creation has finished
  • Disable Print/Download buttons while the PDF is being generated
  • Replace the action icon with a loading spinner while processing
  • Use filenames in the form:teddystudio_labels_YYYY-MM-DD_HH-MM-SS.pdf
  • Handle image/CORS/font loading failures gracefully instead of aborting the whole PDF generation
  • Fall back where possible and surface warnings for skipped resources
  • Fix TypeScript compatibility for PDF byte data when creating the final Blob

This makes TeddyStudio printing independent from the browser's CSS print implementation and should provide consistent output across supported browsers.

Closes #286

Contains Changes from #348

removed additional comma
…ionality using pdf creation for Teddy Studio labels

- Added printLayout.ts for handling label size, paper size, and layout calculations.
- Created printLayout.test.ts for unit tests covering various layout scenarios.
- Developed teddyStudioPdf.ts to generate PDF documents from label layouts, including image and text rendering.
@henryk86

henryk86 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

tested with Chrome and Brave, works fine there.

Firefox not testable in my dev setup, because of #337 last comment.

Edit: Firefox works now too, but the print button just opens the created pdf instead of printing it directly.

…ionality using pdf creation for Teddy Studio labels

- Added printLayout.ts for handling label size, paper size, and layout calculations.
- Created printLayout.test.ts for unit tests covering various layout scenarios.
- Developed teddyStudioPdf.ts to generate PDF documents from label layouts, including image and text rendering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant