project.scala- Contains all dependencies for the projectopenpdfzio.sc- Contains the PdfService trait and implementationexample_usage.sc- Contains examples of how to use PdfService
# Run the basic example
scala-cli run example_usage.sc --main-class PdfServiceExample
# Run the invoice example
scala-cli run example_usage.sc --main-class FunctionalPdfExample
# Run the safe example with error handling
scala-cli run example_usage.sc --main-class SafePdfExample# This will compile all .sc files in the directory together
scala-cli run . --main-class PdfServiceExample# Compile first
scala-cli compile .
# Then run
scala-cli run . --main-class PdfServiceExample- Dependencies: All dependencies are centralized in
project.scala - Automatic Import: Scala CLI automatically compiles all
.scfiles in the same directory together - PdfService Usage: The
PdfServicetrait andPdfServiceLiveimplementation fromopenpdfzio.scare available inexample_usage.sc - ZIO Layer: The service is provided via
PdfService.livelayer
Running any of the examples will create an output.pdf file in the current directory.
- No explicit import of
openpdfzio.scneeded - Scala CLI handles this automatically - All using directives are centralized in
project.scalato avoid conflicts - The PdfService uses ZIO for effect management and resource safety