Jump to content

Alfred PDF Tools – Optimize, encrypt and manipulate PDF files


Recommended Posts

6 hours ago, evanfuchs said:

Merge Error: "Cannot merge a malformed PDF file"

 

I am suddenly getting this error when I attempt to merge PDF files. (v2.16)

 

Any ideas?

 

Unfortunately, I can't reproduce the issue without the offending PDF files. If you still want me to take a look into it you can send me the files via PM.

Edited by xilopaint
Link to comment
  • 5 months later...
15 minutes ago, daerias said:

could you update this workflow for the newest Alfred 4 please? It doesn't show up  PDF Tools in Alfred if I type "Optimize" etc. Thanks :)

 

The workflow works fine with Alfred 4. If you're having a problem, please follow the instructions on providing a useful report:

 

Link to comment
  • 1 month later...

This is a great workflow! Thank you very much for development and support.

 

I have not yet been able to take full advantage of its features due security limitations in macOS. For example, the system won't let you run the "k2pdfopt" script because it is "from an unknown developer". Ughhh...

 

How can I solve this problem?

Monosnap 2020-04-14 09-05-58.png

Link to comment
On 4/14/2020 at 8:38 AM, borzov said:

This is a great workflow! Thank you very much for development and support.

 

I have not yet been able to take full advantage of its features due security limitations in macOS. For example, the system won't let you run the "k2pdfopt" script because it is "from an unknown developer". Ughhh...

 

How can I solve this problem?

Monosnap 2020-04-14 09-05-58.png

 

After trying to run the script, go into system settings – integrity (or something like that). There should be a box offering you to run the script anyway. Press that and then try to run the script again. I had to fiddle around a bit with this with some workflows before I got it to work.

Link to comment
9 hours ago, bivalvegruff said:

After trying to run the script, go into system settings – integrity (or something like that). There should be a box offering you to run the script anyway. Press that and then try to run the script again. I had to fiddle around a bit with this with some workflows before I got it to work.

That's great advice, thank you. I did it!

Link to comment
  • 1 year later...

Hi All,

Hope all is well. I have been trying to merge PDFs with the merge command on my M1 MBP running the latest best of OS Monterey but keep have the following error. Does anyone know how to fix this? Thank you.

 

--------------------

[01:19:43.338] Alfred PDF Tools[Keyword] Processing complete
[01:19:43.341] Alfred PDF Tools[Keyword] Passing output 'test' to Run Script
[01:19:43.547] ERROR: Alfred PDF Tools[Run Script] .
01:19:43 workflow.py:2055 DEBUG    ---------- Alfred PDF Tools (2.16.0) ----------
01:19:43 workflow.py:1462 DEBUG    reading settings from /Users/r/Library/Application Support/Alfred/Workflow Data/com.xilopaint.alfredapp.pdftools/settings.json
01:19:43 workflow.py:2339 DEBUG    update check not due
01:19:43 workflow.py:2074 ERROR    'abs_path'
Traceback (most recent call last):
  File "/Users/r/OneDrive/Alfred.alfredpreferences/workflows/user.workflow.5F1A3B2C-C394-4B63-9DF9-6AE0DF8B5CE4/workflow/workflow.py", line 2067, in run
    func(self)
  File "alfred_pdf_tools.py", line 780, in main
    abs_path = os.environ['abs_path']
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'abs_path'
01:19:43 workflow.py:2097 DEBUG    ---------- finished in 0.020s ----------

Edited by RCL
Link to comment
  • 4 months later...
On 9/6/2019 at 5:32 PM, xilopaint said:

 

Unfortunately, I can't reproduce the issue without the offending PDF files. If you still want me to take a look into it you can send me the files via PM.

I'm having the same issue. I'll send you the offending files by PM and you could look into the issue if you have the time. Thanks for making this workflow, I'm looking forward to using it.

Link to comment
  • 1 month later...
On 2/10/2022 at 6:22 PM, TheThunderChimp said:

I'm having the same issue. I'll send you the offending files by PM and you could look into the issue if you have the time. Thanks for making this workflow, I'm looking forward to using it.

 

Sorry for the late response. I have fully rewritten this workflow using Python 3 and pikepdf (a more modern library than Pypdf). Your files work perfectly in this new unreleased version. The problem is I can't release it until the system Python gets upgraded to 3.10 which can take a long time. I don't know why pikepdf cannot be imported by Python 3.8 and 3.9. If someone gives me some light on what changed on Python 3.10 about imports maybe I can release the new version before the upgrade.

Edited by xilopaint
Link to comment
6 hours ago, xilopaint said:

The problem is I can't release it until the system Python gets upgraded to 3.10

 

There is no system Python. /usr/bin/python3 is a shim which gets you to install the Developer Tools which ship with that older version. Don’t wait for it to be updated, because there’s no clue when or if that will happen. If you really need a higher Python version, recommend installing via Homebrew and set export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}". Other Python 3 developers do it, and it’s better than not having access to the Workflow.

Link to comment
On 3/16/2022 at 1:29 PM, xilopaint said:

The problem is I can't release it until the system Python gets upgraded to 3.10 which can take a long time. I don't know why pikepdf cannot be imported by Python 3.8 and 3.9. If someone gives me some light on what changed on Python 3.10 about imports maybe I can release the new version before the upgrade

 

Maybe @deanishe has a say here? The issue is really weird. If I install pikepdf using pip install pikepdf -t . I get an import error with Python 3.8.9 and Python 3.9.10, although Python 3.10.2 works good. On the other hand I don’t get any error if I don’t use the -t flag at all to install the package. Obviously I’m using the flag because I want to embed the workflow with the package.

Edited by xilopaint
Link to comment

@xilopaint You should open an issue on the library's bug tracker. It claims to support 3.7+.

 

Also, like Vítor says, there is no Python 3 on macOS by default, so I wouldn't sweat over using a Homebrew Python instead of an Apple one.

 

The Apple one is slightly preferable, as the devtools are easier to install than Homebrew.

Edited by deanishe
Link to comment
  • 2 weeks later...
On 3/16/2022 at 12:29 PM, xilopaint said:

 

Sorry for the late response. I have fully rewritten this workflow using Python 3 and pikepdf (a more modern library than Pypdf). Your files work perfectly in this new unreleased version. The problem is I can't release it until the system Python gets upgraded to 3.10 which can take a long time. I don't know why pikepdf cannot be imported by Python 3.8 and 3.9. If someone gives me some light on what changed on Python 3.10 about imports maybe I can release the new version before the upgrade.

Okay, I'm liking forward to the release! I don't mind using Homebrew.

Link to comment
On 3/16/2022 at 1:29 PM, xilopaint said:

 

Sorry for the late response. I have fully rewritten this workflow using Python 3 and pikepdf (a more modern library than Pypdf). Your files work perfectly in this new unreleased version. The problem is I can't release it until the system Python gets upgraded to 3.10 which can take a long time. I don't know why pikepdf cannot be imported by Python 3.8 and 3.9. If someone gives me some light on what changed on Python 3.10 about imports maybe I can release the new version before the upgrade.

 

I got over this issue and the workflow will work with Developer Tools. I  can offer v3 beta builds to some people willing to give me feedback through Telegram. Who's up?

 

@evanfuchs @TheThunderChimp

Link to comment

Big changes were made in v3. Unfortunately, because of macOS constraints regarding unsigned binaries, the adoption of pikepdf made the new version around 5 seconds slower. Making the new version faster would require the user either installing pikepdf manually or allowing a large amount of binaries, which I decided to avoid.

 

Any feedback about v3 is appreciated.

 

Thanks to @katiefor testing beta builds before v3 release.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...