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

Add a thin wrapper around Skia's PDF backend #775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LoadingByte
Copy link
Contributor

Skia has a convenient PDF backend that turns draw calls into PDF pages. It would be amazing to have access to that backend in Skiko too.

This changeset adds a direct wrapper around Skia's PDF API. I left out the following features:

  • SkPDF::Metadata::fStructureElementTreeRoot together with SkPDF::SetNodeId, which make up an API for adding semantic annotations to elements in the PDF. I deemed this not useful enough to justify the cost of implementing it at this point.
  • SkPDF::Metadata::fExecutor, which is an experimental API for multithreading the creation of PDFs. As Skiko doesn't support the SkExecutor yet, adding this would have incurred high cost for possibly little reward.
  • SkPDF::Metadata::fSubsetter, which allows to choose between two font subsetters, one of which is already deprecated and will thus likely be removed by the Skia team in the near future.
  • SkDocument::abort, which just waits for all background threads to terminate and then returns. This seems non-useful and even confusing because we don't support PDF multithreading.

In contrast to my color space changeset, where I wrote POJOs to mirror the existing codebase, I now decided to employ data classes. If you for some reason want to avoid data classes in Skiko, just tell me, and I'll refactor them back to POJOs.

I'm looking forward to your comments.

@dima-avdeev-jb dima-avdeev-jb self-requested a review August 1, 2023 09:21
@dima-avdeev-jb
Copy link
Contributor

Thanks for PR! We will need some time to review it.

@dima-avdeev-jb dima-avdeev-jb removed their request for review August 1, 2023 13:41
@Phaestion
Copy link
Contributor

We would love to have this functionality in Skiko! Any update on when this can be merged?

@dima-avdeev-jb
Copy link
Contributor

We would love to have this functionality in Skiko! Any update on when this can be merged?

Sorry, not yet. For now we have higher priority tasks.

@sgopi93
Copy link

sgopi93 commented Feb 26, 2024

@LoadingByte can you include SkAnnotateRectWithURL with this PR, if possible

@LoadingByte
Copy link
Contributor Author

@sgopi93 I too believe that'd be a great addition, but seeing as this PR already lingers for seven months, I think the best bet to getting it merged some day is to keep it very basic and not inflate it even further for the time being. Once the Skiko team merged it, feel free to file a follow-up PR with support for the three functions in SkAnnotation.h :)

@sgopi93
Copy link

sgopi93 commented May 8, 2024

Hi @LoadingByte , Is it possible you to merge this branch with master. As this branch is far behind master?

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.

None yet

4 participants