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
CairoMakie: Allow restricting PDF version #3845
base: master
Are you sure you want to change the base?
Conversation
21ec306
to
7a71fc5
Compare
7a71fc5
to
713efce
Compare
08fee5d
to
e1f5a49
Compare
I have added an entry to changelog and documented the new config option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
e1f5a49
to
8940126
Compare
Rebased to resolve new conflicts |
The error is not related imho:
|
CI's green ✅ Thank you, Simon. |
1b29111
to
fc572a2
Compare
Rebased to fix conflicts. |
fc572a2
to
aa057ee
Compare
aa057ee
to
74291b0
Compare
@@ -74,3 +74,10 @@ function get_render_type(surface::Cairo.CairoSurface) | |||
typ == Cairo.CAIRO_SURFACE_TYPE_IMAGE && return IMAGE | |||
return IMAGE # By default assume that the render type is IMAGE | |||
end | |||
|
|||
function restrict_pdf_version!(surface::Cairo.CairoSurface, v::Integer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be simpler to type the v
with the enum here, then you don't need yet another check. I'd guess you don't even have to manually convert it to Int32 in the ccall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to move restrict_pdf_version!
to Cairo.jl eventually, where they stick to numerical constants instead of enums, so I'd prefer to keep the argument as Integer
.
You are right that the manual conversion in the ccall is not needed. I removed it.
74291b0
to
529ca53
Compare
Description
This PR allows users to restrict the version of an output PDF like this:
This feature was discussed on Discourse (and also earlier)
Type of change
Checklist
I need guidance regarding documentation (where to best put this)
and testing (I am not sure how to check a PDF's version in Julia).Also I was thinking that the
CAIRO_PDF_VERSION_*
constants together withrestrict_pdf_version!
should perhaps go to Cairo.jl. What do you think?