GithubHelp home page GithubHelp logo

ajaxray / markpdf Goto Github PK

View Code? Open in Web Editor NEW
156.0 10.0 31.0 39 KB

Watermark PDF files using image or text

License: GNU Affero General Public License v3.0

Shell 4.77% Go 95.23%
pdf watermark pdf-document cli utility developer-tools watermark-pdf-files

markpdf's Introduction

Anis Uddin Ahmad - Cover Photo

Hi ๐Ÿ‘‹ - Assalamu'Alaikum (Peace be upon you)!

I am Anis Uddin Ahmad, a software architect with 11+ years of experience in designing and building enterprise applications. I absolutely love programming, from designing system architecture to developing OSS tools for solving granular problems.

Language & Data:

Frameworks & Tools:

Stats:

Anis Uddin Ahmad's GitHub stats Anis Uddin Ahmad's Top Langs

markpdf's People

Contributors

abellykens avatar ajaxray avatar ankurgel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markpdf's Issues

Watermark position ignored

I specify -x -10 -y -10 as position to have watermark to the bottom right but with some pdf documents the tool doesn't respect the position specified and moves the watermark to the top right. Why does this happen?

File need to be decrypted first

Hi,

The package was working fine, until today... Some of the PDF's can't be handled because i get this error message:

Output:\n================\nERROR: Failed to get PageCount of the source file. [File need to be decrypted first] \n\n\nError Output:\n================\n",

The PDF can be openend without password so i dont understand why it tells it has to be decrypted

Compilation issue

As-Salamu Alaikum,

$ go build -ldflags=-s .

github.com/unidoc/unidoc/pdf/model

C:\Users\0wner\go\src\github.com\unidoc\unidoc\pdf\model\writer.go:538:12: constant 4294967295 overflows int

How do proceed?

Thanks in advance.

SVG file support

It would be nice to have the option to add watermark from a scalable format, like SVG.

In-document bookmarks and links are removed once marked with this tool

I have found that if I have a PDF document that has bookmarks and links for easy navigation, all of them are removed once I mark my PDF using this tool. Hope that a fix could be implemented so the marked PDF will preserve the bookmarks and links it originally contained. Thanks in advanced!

Text Opacity not working like image opacity.

Hello @ajaxray ,

I'm using the command "markpdf "test_text.pdf" "Approved, Not published" "/var/www/html/test_text_out.pdf" -c -s 20.0 -a 45 -o 0.5" for add text as watermark, but the watermark is very dark. I also change opacity 0.1 but in both cases, the watermark looks the same.
test_text.pdf

But in the case of an image it's work fine.

Thank You In advance

Apple Silicon

Maybe I'm missing something, but is there a way to build this for Apple Silicon? I see the Darwin build, but it is not for ARM 64 as far as I can tell. Same goes for the build.sh. No way to build for Darwin + Arm

MarkPDF working in terminal but not in Laravel > Process

Hi,

hopelly someone can help because this bug is driving me crazy.

Initially everything worked fine until few weeks ago.
I have updated markpdf with the latest version.

When i use process, the isSuccessful() returns true,
But the file is not modified.

When i use the exact same options as in process but paste this in the terminal.
Then the file is modified correctly.

This is driving me nuts because i can't make it to work with process and cant see any error messages.

Hopelly someone has an answer.

PDF I/O as base64

Will be good if we could have the possibility to use PDF base64 as input or in the output

Open source?

Hi,

You state that this is open source, but when I compiled this it required a unidoc dependency from Github. Although your built binaries work fine, when I compile it now, a watermark is added to the file from Unidoc and a license error is thrown.

I was trying to introduce a configuration option so that the watermark was only applied to the first page, but now this isn't possible.

Is this something you can revise?

Avira Security Alert

Hi,

I have a security problem running the program. I am using Windows 10 + Avira Free Security v1.1.57.24596.

Steps to reproduce:

  1. Download a release for Windows: Releases > markpdf_windows-386.exe
  2. Set appropriate execution permissions
  3. Run markpdf "path/to/source.pdf" "img/logo.png" "path/to/output.pdf"
  4. The popup below appears from Avira

image

How to add new line in text placeholder?

I am trying to add 2 lines(rows or line break) placeholder. I am using php to call command and trying to add new line "\n".

It gives no error and also no placeholder added in pdf. If I remove new line chars it works but in one line.

Is there any way I can add 2 lines as text placeholder?

invalid media box causes output to be all blank

I have a PDF file that seems to have an invalid media box. The file opens fine using Adobe PDF reader, so I assume there's a standard default being used.

I can't provide the original file since it has sensitive information on it, and when I edit it, it "corrects" for the error.

I do I have a verbose output capture, and I can provide the output PDF.

markpdf bad.pdf "Test" bad_output.pdf --opacity=1 --font-size=12 --offset-x=10 --offset-y=10 -v
2023/01/03 14:30:05 Input PDF: bad.pdf
2023/01/03 14:30:05 No file exists at: Test, assuming Text Watermark.
[DEBUG]  parser.go:1530 Pdf version 1.7
[DEBUG]  main.go:131 Failed to get page mediabox: Invalid media box
2023/01/03 14:30:05 Page Width       : 0
2023/01/03 14:30:05 Page Height      : 0
2023/01/03 14:30:05 Paragraph width: 19.450000
2023/01/03 14:30:05 Paragraph height: 10.000000
2023/01/03 14:30:05 Offsets x: 10.000000, y: 10.000000

bad_output.pdf

I'll see if I can get the source code to work and hard-code some values and see if that makes a difference.

Bus Error

Hi. Code works on my local but when i deploy it to my linux server i get a "Bus Error". Can't seem to find any more information around what's causing this.

Any ideas?

PDF properties?

Hi, first, thanks for a great utility! It's working great in testing so far.

Is there any scope for adding PDF properties, such as title, copyright, author etc?

Background color and Horizontal Center

Hi, thanks for this useful tool

Is there a way to set text background color?

And to center the watermark horizontally while defining a vertical offset (for instance, center at bottom of page)?

Thank you.

Image resolution

I would like to use a program to add a stamp. The stamp has a permanent dimension and rich content. Can you add the DPI option to the image? The standard is 72 DPI and the stamp is too big. If I give 144 DPI, the image will be two times smaller without losing quality. 300 DPI will add a small image with high resolution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.