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

Update examples #193

Closed
littlejiancc opened this issue May 28, 2020 · 1 comment
Closed

Update examples #193

littlejiancc opened this issue May 28, 2020 · 1 comment
Assignees

Comments

@littlejiancc
Copy link

image
image

ExampleAddWatermarksFile

onTop = true
wm, _ = pdfcpu.ParsePDFWatermarkDetails("stamp.pdf:2", "s:.5 a, d:2", onTop)
AddWatermarksFile("in.pdf", "", nil, wm, nil)

the example for AddWatermarksFile doesn't modify,it will return ambiguous parameter prefix "s"
And can you give a explain list for the parm's ?

Thx for your great project!

@hhrutter
Copy link
Collaborator

Hello!
Thanks for reporting this!

😞 I need to update the examples.

Generally, you can use any unique abbreviation for all parameters in the watermark description:

So for example:

"d" is the same like "dia" is the same like "diagonal" or
"op" is the same like "opacity" but
"o" is ambiguous because there are 2 parameters starting with "o": "offset" and "opacity".

Since v0.3.3 introduced "strokeColor", "s" which used to be unique for "scaleFactor" is now ambiguous.

Short answer:
Use: "sc" or "scalefactor" for all instances in the examples where "s" is used
and "ma" for all instances where "m" is used because now we have "margins" on top of "mode" which is a synonym for "renderMode".

Don't forget to check out the documentation for stamping with pdfcpu.

@hhrutter hhrutter changed the title ParsePDFWatermarkDetails:ambiguous parameter prefix "s" Update examples May 28, 2020
@hhrutter hhrutter self-assigned this May 28, 2020
@hhrutter hhrutter reopened this May 28, 2020
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

No branches or pull requests

2 participants