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

[Feature] Image tiles all over the page #24

Merged
merged 5 commits into from
Dec 27, 2022

Conversation

AnkurGel
Copy link
Contributor

Synatax:

markpdf pdf.pdf ~/Downloads/logo.jpeg out.pdf -p10 -t

In above syntax, using -p to scale the image to 10% and -t to generate tiles all over the page. Result: pattern like below:
image

You can also use an additional flag -z or --spacing to add spacing b/w the tiles.

markpdf pdf.pdf ~/Downloads/logo.jpeg out.pdf -p10 -t -z20

image

)

// Watermarkable is a common interface for watermarkable image or paragraph
type Watermarkable interface {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have written as an interface for it to work with both paragraph and image

@@ -22,14 +22,24 @@ func drawText(p *creator.Paragraph, c *creator.Creator) {
p.SetColor(creator.ColorRGBFromHex("#" + color))
p.SetAngle(angle)

// Encountering problem with tiles and text watermark. Contributions welcome.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason, the tiles in paragraph isn't working fine. Generates error after couple of iterations:

[DEBUG] contentstream.go:94 ERROR: Name too long (Font100000000...
@ajaxray can you check if you can make it work? Can be targeted outside the scope of this PR.

@AnkurGel
Copy link
Contributor Author

Hey @ajaxray. Did you get a chance to review this and the other PR?

@ajaxray
Copy link
Owner

ajaxray commented Dec 11, 2022

@AnkurGel,
This is another great addition to this tool.
Will check and merge soon :)

@ajaxray ajaxray merged commit f79d0da into ajaxray:master Dec 27, 2022
@ajaxray
Copy link
Owner

ajaxray commented Dec 27, 2022

Merged with many many thanks. 😄
I've added a new release based on the new features you've added.
https://github.com/ajaxray/markpdf/releases/tag/1.0.1

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.

2 participants