Skip to content

[Feature] Image tiles all over the page - #24

Merged
ajaxray merged 5 commits into
ajaxray:masterfrom
AnkurGel:image_tiles
Dec 27, 2022
Merged

ajaxray merged 5 commits into
ajaxray:masterfrom
AnkurGel:image_tiles

Conversation

@AnkurGel

Copy link
Copy Markdown
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

Comment thread tiles.go
)

// Watermarkable is a common interface for watermarkable image or paragraph
type Watermarkable interface {

Copy link
Copy Markdown
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

Comment thread text_watermark.go
p.SetColor(creator.ColorRGBFromHex("#" + color))
p.SetAngle(angle)

// Encountering problem with tiles and text watermark. Contributions welcome.

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@ajaxray

ajaxray commented Dec 11, 2022

Copy link
Copy Markdown
Owner

@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

ajaxray commented Dec 27, 2022

Copy link
Copy Markdown
Owner

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

⌂ 换网址