dkyowell / PDFBlocks

A Swift library for generating PDF documents and reports with a SwiftUI like syntax.
MIT License
14 stars 0 forks source link

URL #13

Open tazmancoder opened 3 weeks ago

tazmancoder commented 3 weeks ago

First, I’m very interested in this library for an app I’ve been developing.

  1. Is there a way to get the URL of the created PDF?
  2. Where is the PDF located and with what name?
  3. Can you give the PDF a different name?
  4. Also, I like the table example, the only thing is I’m a junior dev. How could I use that with a Swift Data object that is called a program and has multiple songs per program.

‘anyway, I’d love to hear your thoughts or when this library might be out of beta.

dkyowell commented 1 week ago

renderPDF() returns the pdf as an in-memory Data type. From there, you can persist the data if you like using Data.writeTo and give it whatever name or url you like.

The Table block operates on an array of a single data type and not with nested data as you describe. If you need to produce a report on a single program, pass program.songs as the data array for Table. If you need to produce a report on several programs, you would need to "flatten your data first". e.g:

Program Name; Program Year Released; Song Number; Song Name

Prog Name 1. 2024 1 Song Name 1 Prog Name 1. 2024 2 Song Name 2 Prog Name 1. 2024 3 Song Name 3 Prog Name 2. 2020 1 Song Name 1 Prog Name 2. 2020 2 Song Name 2 Prog Name 2. 2020 3 Song Name 3

I don't think I have implemented it yet, but at some point, a Table will be able to be nested within another Table and you would be able to pass [programs] to the outer table and program.songs to the inner table...

I hope this is enough info to help you get started.

I have not been actively working on this for several months. The soonest I foresee this coming out of beta would be a year from now.

tazmancoder commented 1 week ago

Since this is in beta, would it be safe to use this in my project?-Mark/*Mark J PerrymanApple Product @. Nov 13, 2024, at 18:27, David Yowell @.> wrote: renderPDF() returns the pdf as an in-memory Data type. From there, you can persist the data if you like using Data.writeTo and give it whatever name or url you like. The Table block operates on an array of a single data type and not with nested data as you describe. If you need to produce a report on a single program, pass program.songs as the data array for Table. If you need to produce a report on several programs, you would need to "flatten your data first". e.g: Program Name; Program Year Released; Song Number; Song Name Prog Name 1. 2024 1 Song Name 1 Prog Name 1. 2024 2 Song Name 2 Prog Name 1. 2024 3 Song Name 3 Prog Name 2. 2020 1 Song Name 1 Prog Name 2. 2020 2 Song Name 2 Prog Name 2. 2020 3 Song Name 3 I don't think I have implemented it yet, but at some point, a Table will be able to be nested within another Table and you would be able to pass [programs] to the outer table and program.songs to the inner table... I hope this is enough info to help you get started. I have not been actively working on this for several months. The soonest I foresee this coming out of beta would be a year from now.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

dkyowell commented 1 week ago

I would not use it in an app you plan to submit to the AppStore, but it is safe for personal projects.

tazmancoder commented 1 week ago

Ok,

The app I want to use it in in already on the AppStore. I will start playing with it in the app and wait for release before submitting to the AppStore.

Thanks,

-Mark/*

Mark J Perryman Apple Product Enthusiast @.***

On Nov 14, 2024, at 05:54, David Yowell @.***> wrote:

I would not use it in an app you plan to submit to the AppStore, but it is safe for personal projects.

— Reply to this email directly, view it on GitHub https://github.com/dkyowell/PDFBlocks/issues/13#issuecomment-2476285417, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6AQVZPILJW6V6AFMZWOH32ASMPRAVCNFSM6AAAAABRCCO5N6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWGI4DKNBRG4. You are receiving this because you authored the thread.