GithubHelp home page GithubHelp logo

andycybersec / pylovepdf Goto Github PK

View Code? Open in Web Editor NEW
73.0 8.0 24.0 70 KB

ilovepdf.com python API library

License: GNU General Public License v3.0

Python 100.00%
python pdf unlock compress watermark ilovepdf officetopdf pdfeditor pdfa unlockpdf

pylovepdf's People

Contributors

andycybersec avatar aster94 avatar markhaakman avatar mrpaperbag avatar oscar6echo avatar r0dz avatar sinistro14 avatar tgrandje 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylovepdf's Issues

Can't add an image watermark (Error: DamagedFile)

Hello,

watermark tool works perfectly with a text mark,
but it doesn't with an image:

from pylovepdf.tools.watermark import Watermark

t = Watermark(public_key, verify_ssl=True, proxies='')
t.add_file('document.pdf')
t.debug = False
t.image = 'image.png'

t.set_output_folder('./')

t.execute()
t.download()
t.delete_current_task()

the result is:

Uploading file...
File uploaded! Below file stats:
Error type: ProcessingError
message: This task can't be processed. Check why in the params.
text: ['Text cannot be blank.']
status: 400

no file to be downloaded
Task delete status: 200

How to rotate -90° (or 270) a PDF File?

Hello!

First at all, thanks for this amazing wrapper!

Can't find the way to to rotate -90° (or 270) a PDF File,
I tried with -90, 270 and 'left', any of them modifies the position.

ModuleNotFoundError: No module named 'pylovepdf.tools.pdfjpg'

task = ilovepdf.new_task('pdfjpg')

File "/home/anton/PycharmProjects/AnalyseStepInUniversity/venv/lib/python3.10/site-packages/pylovepdf/ilovepdf.py", line 101, in new_task
module_name = importlib.import_module('.tools.' + tool.lower(), package='pylovepdf')
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pylovepdf.tools.pdfjpg'

can we give a specific filename to the compress Class

Is it possible to give a specific filename for this example here. Its was not an issue until i found that the tz of the API server and mine is different so if do

tday = date.today().strftime("%d-%m-%Y")
        return True, f'{location}/compress_{tday}.pdf'

the date will be different.

download will overwrite the previous files

I'm trying to loop over several files. When I download the pdfs and store them in a folder, they all get the same name (split_date_range.pdf), overwritting the previous files.

I had to overwrite the download method in task such that filename = self.output_filename.

AttributeError: 'Response' object has no attribute 'token'

I'm having this issue while "Watermark" tool

Traceback (most recent call last):
  File "add_watermark.py", line 16, in <module>
    task = Watermark(secret_key,
  File "C:\Users\Usuário\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylovepdf\tools\watermark.py", line 28, in __init__
    super(Watermark, self).__init__(public_key, True, verify_ssl, proxies)
  File "C:\Users\Usuário\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylovepdf\task.py", line 42, in __init__
    self.auth()
  File "C:\Users\Usuário\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pylovepdf\task.py", line 50, in auth
    self._set_token(response.token)
AttributeError: 'Response' object has no attribute 'token'

Error when using `new_task()` method

Using new_task() with tool names as described in https://github.com/AndyCyberSec/pylovepdf#tools gives me some errors.
Check this gist out. My output is the following:

TOOL: imagepdf
No module named 'pylovepdf.tools.imagepdf'
TOOL: officepdf
module 'pylovepdf.tools.officepdf' has no attribute 'Officepdf'
TOOL: pdfa
module 'pylovepdf.tools.pdfa' has no attribute 'Pdfa'
TOOL: pdfjpg
No module named 'pylovepdf.tools.pdfjpg'
TOOL: validatepdfa
module 'pylovepdf.tools.validatepdfa' has no attribute 'Validatepdfa'

This is a generalization of #15 and #16

⭐   BTW, thanks for your pretty work!

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.