Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: PDF generation #220

Merged
merged 18 commits into from
Apr 23, 2024
Merged

Added: PDF generation #220

merged 18 commits into from
Apr 23, 2024

Conversation

daanggc
Copy link
Contributor

@daanggc daanggc commented Apr 12, 2024

PDF generation and more improvements

You can preview it here: https://binarykits.dvdg.nu/

image

Added PDF generation (with selectable text)

  • Uses SKNWayCanvas to be able to draw on multiple canvases (Image and PDF)
  • Inverted/Reverse printing is fixed in the PDF using a final image that filters everything that should be white
    image +this inverted image = image

Added: Download ZPL, PNG, and PDF buttons in the web interface
image

Added: GraphicCircle supports reverse draw now
image

Improved: GraphicBox rounding and border settings
image vs image

Improved: Inverted/Reverse printing

  • Only GraphicBox/Circle is a bitmap operation now
  • The rest is rendered using SKBlendMode.Xor
  • Color swapping is done using SKColorFilter.CreateColorMatrix for bitmap operations
  • When white is printed with ^FR, we simply change the color to black or don't invert the color
  • The performance is great! (The GLS label from Speedup drawing of reversed elements #64, added as Example11 is 100ms instead of 400ms now)

Old:
image

New:
image

Other small improvements:

  • Added: Extra test and examples
  • Added: Tabs for tests and examples that are sorted on the web interface
  • Improved: View controller calls can assume that the image needs a white background
  • Improved: Examples change the canvas size in the web interface (And the overlay isn't limited to full inches anymore)

Based on: #217 #218 #219 and used the improvement from #193 while trying to resolve the mentioned issues in #64

Daniël van der Garde added 17 commits March 24, 2024 15:18
Improved: Courier New is more often available than Courier
Improved: PDF417 scaling
Improved: DHL uses a decimal height for PDF417
Improved: PDF417 size when no column value is given
Added: Download buttons for ZPL, PNG and PDF
Fixed: GraphicBox radius with thicker lines
Improved: Invert/Reverse draw results when using white elements
Improved: White background for PNG requested from viewer
Improved: Tabs for tests and examples in webinterface
Improved: Performance of GraphicBox rounding fix
Added: GraphicCircle supports reverse draw now
Improved: Overlay can handle custom label sizes better now
@daanggc daanggc changed the title PDF generation Added: PDF generation Apr 12, 2024
@primo-ppcg primo-ppcg merged commit a6ea70a into BinaryKits:develop Apr 23, 2024
2 checks passed
@primo-ppcg primo-ppcg mentioned this pull request Apr 26, 2024
primo-ppcg added a commit that referenced this pull request Apr 26, 2024
* Create dotnet - test.yml

* Bump SkiaSharp from 2.88.3 to 2.88.6 in /src/BinaryKits.Zpl.Viewer

Bumps [SkiaSharp](https://github.com/mono/SkiaSharp) from 2.88.3 to 2.88.6.
- [Release notes](https://github.com/mono/SkiaSharp/releases)
- [Commits](mono/SkiaSharp@v2.88.3...v2.88.6)

---
updated-dependencies:
- dependency-name: SkiaSharp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(viewer): cannot find package vue@next (#208)

* fix(viewer): cannot find package vue@next

* Update index.html

Don't use specific versions for web dependencies.

* Enable ^FV command (needed for UPS) (#195)

* Enable ^FV command

- Based off ^FD

* ZPL Parser: Enable ignoring certain commands (#194)

* Enable ignoring certain commands

- small refactors + comments in the zpl parser

* Comment specification

* Add documentation on how to add barcode support (#198)

* Change invertdraw to skia xor blending (#193)

- Also added tests
- Refactored viewer tests

* Structure Viewer UnitTest project (merge after #193) (#199)

* Change invertdraw to skia xor blending

- Also added tests
- Refactored viewer tests

* Begin structuring viewer testing project

- readme for goals
- custom test for feature development
- zpl/png data folder copied to output
- factor out more to common

* Try to fix cannot copy data to output for linux build

* Copy data again

* Capitalization mistake

* Added: Font fallback structure for the default fonts. (#217)

* Added: Font fallback structure for the default fonts.

* Improved: DejaVu Sans Mono as first mono type
Improved: Courier New is more often available than Courier

* Added: Roboto font to Dockerfile

* Improved: Enabled antialiased text (#218)

* Improved: Barcode scaling for PDF417 and Code128 (#219)

* Improved: Code128 charset usage
Improved: PDF417 scaling
Improved: DHL uses a decimal height for PDF417
Improved: PDF417 size when no column value is given

* Improved: PDF417 uses correct vertical scaling now

* Improved: GS1 type support
Improved: Code128 invocation filtering

* Added: PDF generation (#220)

* Added: Font fallback structure for the default fonts.

* Improved: DejaVu Sans Mono as first mono type
Improved: Courier New is more often available than Courier

* Improved: Enabled antialiased text

* Improved: Code128 charset usage
Improved: PDF417 scaling
Improved: DHL uses a decimal height for PDF417
Improved: PDF417 size when no column value is given

* Added: Roboto fontface to docker image

* Improved: Added a working roboto font to the Dockerfile

* Improved: PDF417 uses correct vertical scaling now

* Added: PDF support
Added: Download buttons for ZPL, PNG and PDF
Fixed: GraphicBox radius with thicker lines
Improved: Invert/Reverse draw results when using white elements
Improved: White background for PNG requested from viewer

* Added: More real world tests
Improved: Tabs for tests and examples in webinterface

* Improved: GraphicBox can't have a border smaller than 1

* Improved: Made more ^FR blending native for performance

* Improved: GraphicBox border should not exceed half of the smallest side.
Improved: Adjusted some example sizes

* Fixed: Build issues

* Improved: More Skia blending to improve performance
Improved: Performance of GraphicBox rounding fix
Added: GraphicCircle supports reverse draw now
Improved: Overlay can handle custom label sizes better now

* Improved: Overlay requests may use wrong number formatting

* Bump Dependencies

Bump ImageSharp and SkiaSharp dependencies.

* Added: MaxiCode support (#224)

* Added: MaxiCode support

* Improved: Slight finetune on maxicode linux fix

* Patch #194 (#227)

Don't neglect to append on ignore.

* Added: Barcode93 support (#226)

* Added: Barcode93 support

* Update Code93

Update interpretation line
Add test to WebApi

* Fix vue lib URL (#228)

* Drop BarcodeLib dependency (#229)

* Drop BarcodeLib dependency

* don't inline regex

* Prepare for release

* Silence warnings

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yiping <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitrii Savchenkov <[email protected]>
Co-authored-by: reportingissue <[email protected]>
Co-authored-by: Daniël van der Garde <[email protected]>
Co-authored-by: Marius Starke <[email protected]>
Co-authored-by: Yiping <[email protected]>
primo-ppcg added a commit that referenced this pull request Apr 26, 2024
* Create dotnet - test.yml

* Bump SkiaSharp from 2.88.3 to 2.88.6 in /src/BinaryKits.Zpl.Viewer

Bumps [SkiaSharp](https://github.com/mono/SkiaSharp) from 2.88.3 to 2.88.6.
- [Release notes](https://github.com/mono/SkiaSharp/releases)
- [Commits](mono/SkiaSharp@v2.88.3...v2.88.6)

---
updated-dependencies:
- dependency-name: SkiaSharp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(viewer): cannot find package vue@next (#208)

* fix(viewer): cannot find package vue@next

* Update index.html

Don't use specific versions for web dependencies.

* Enable ^FV command (needed for UPS) (#195)

* Enable ^FV command

- Based off ^FD

* ZPL Parser: Enable ignoring certain commands (#194)

* Enable ignoring certain commands

- small refactors + comments in the zpl parser

* Comment specification

* Add documentation on how to add barcode support (#198)

* Change invertdraw to skia xor blending (#193)

- Also added tests
- Refactored viewer tests

* Structure Viewer UnitTest project (merge after #193) (#199)

* Change invertdraw to skia xor blending

- Also added tests
- Refactored viewer tests

* Begin structuring viewer testing project

- readme for goals
- custom test for feature development
- zpl/png data folder copied to output
- factor out more to common

* Try to fix cannot copy data to output for linux build

* Copy data again

* Capitalization mistake

* Added: Font fallback structure for the default fonts. (#217)

* Added: Font fallback structure for the default fonts.

* Improved: DejaVu Sans Mono as first mono type
Improved: Courier New is more often available than Courier

* Added: Roboto font to Dockerfile

* Improved: Enabled antialiased text (#218)

* Improved: Barcode scaling for PDF417 and Code128 (#219)

* Improved: Code128 charset usage
Improved: PDF417 scaling
Improved: DHL uses a decimal height for PDF417
Improved: PDF417 size when no column value is given

* Improved: PDF417 uses correct vertical scaling now

* Improved: GS1 type support
Improved: Code128 invocation filtering

* Added: PDF generation (#220)

* Added: Font fallback structure for the default fonts.

* Improved: DejaVu Sans Mono as first mono type
Improved: Courier New is more often available than Courier

* Improved: Enabled antialiased text

* Improved: Code128 charset usage
Improved: PDF417 scaling
Improved: DHL uses a decimal height for PDF417
Improved: PDF417 size when no column value is given

* Added: Roboto fontface to docker image

* Improved: Added a working roboto font to the Dockerfile

* Improved: PDF417 uses correct vertical scaling now

* Added: PDF support
Added: Download buttons for ZPL, PNG and PDF
Fixed: GraphicBox radius with thicker lines
Improved: Invert/Reverse draw results when using white elements
Improved: White background for PNG requested from viewer

* Added: More real world tests
Improved: Tabs for tests and examples in webinterface

* Improved: GraphicBox can't have a border smaller than 1

* Improved: Made more ^FR blending native for performance

* Improved: GraphicBox border should not exceed half of the smallest side.
Improved: Adjusted some example sizes

* Fixed: Build issues

* Improved: More Skia blending to improve performance
Improved: Performance of GraphicBox rounding fix
Added: GraphicCircle supports reverse draw now
Improved: Overlay can handle custom label sizes better now

* Improved: Overlay requests may use wrong number formatting

* Bump Dependencies

Bump ImageSharp and SkiaSharp dependencies.

* Added: MaxiCode support (#224)

* Added: MaxiCode support

* Improved: Slight finetune on maxicode linux fix

* Patch #194 (#227)

Don't neglect to append on ignore.

* Added: Barcode93 support (#226)

* Added: Barcode93 support

* Update Code93

Update interpretation line
Add test to WebApi

* Fix vue lib URL (#228)

* Drop BarcodeLib dependency (#229)

* Drop BarcodeLib dependency

* don't inline regex

* Prepare for release

* Silence warnings

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yiping <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dmitrii Savchenkov <[email protected]>
Co-authored-by: reportingissue <[email protected]>
Co-authored-by: Daniël van der Garde <[email protected]>
Co-authored-by: Marius Starke <[email protected]>
Co-authored-by: Yiping <[email protected]>
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.

Viewer convert to PDF instead image
2 participants