this post was submitted on 20 Jun 2025
34 points (97.2% liked)

Open Source

38082 readers
164 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
 

So one of my pdfs has a page number and a link at the bottom of every page. It's around 500 pages so I dont want to edit it manually. Is there any way I can delete those things all at once from all pages of the pdf?

Maybe ghost script or python script can do this?

I also notice there isn't a PDF community in Lemmy, maybe somebody should create one.

Thanks a lot in advance.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] -5 points 15 hours ago (7 children)

Ask chatgpt for a python script to do exactly that task. Maybe you get what you want, maybe not.

Helped me out quite a few times with niche tasks like this.

[–] [email protected] 4 points 15 hours ago (5 children)

Look at how to do it with python, you'll learn interesting stuff, get a working result, and not destroy your brain using a chat simulator as a programming help.

I don't get why people are fine with comments that are as absurd as saying "to hang a painting, first stab a screwdriver in the wall then attach the painting to it, sometimes it's not too bad"

[–] [email protected] -2 points 14 hours ago (2 children)

How is asking chatgpt to do it any different as to using a different pre made tool? Both do not require programming.

[–] [email protected] 3 points 13 hours ago

How is using a spoon different as to using a military tank? They're both tools after all.

[–] [email protected] 3 points 13 hours ago (1 children)

Pre-made tools have reproducible and known functionality that has been tested whereas LLM's when generating this across 100 different users may come up with 100 different untested results in which someone who doesn't know programming won't really know what complete result to expect from the code it generates.

In short, pre made tools don't require programming knowledge because someone has handled all of this for you previously, but LLM's do require programming knowledge to make sure what it made is going to work safely and correctly.

[–] [email protected] -1 points 11 hours ago (1 children)

Sure, but the OP has a singular task to fulfill which he can easily check if it is done correctly. The premade tools don’t have the functionality, now what? Tell him to learn how to code?

[–] [email protected] 2 points 8 hours ago* (last edited 2 hours ago)

Tell him to learn how to code?

Optimally yes, the OP should learn some code before doing so - this task doesn't seem that difficult to do with a script if you wrote it yourself, and it's even less work to learn enough to just verify what the script is doing.

I have no idea how a car works at a deep level. However I know enough to know how to drive, and if I see its mirrors are broken off, the seat belts are missing, or there is gas leaking out of it onto the ground, I probably shouldn't get in and drive it.

If you don't understand code and run generated code, the problem is that you are stuck with a result that you may or may not have wanted. You may also just think it worked correctly when in fact It might have done other stuff as well that can't be seen plainly - this is the inherent risk of running generated code where you can't actually verify what it's doing.

Maybe it performs the requested function correctly but is sourcing the original code from a use case where someone also wanted to delete every other kind of file that wasn't a pdf in that directory. Maybe not. But this is a difference of one line of code which can have major ramifications if it gets left in.

The point is that if you aren't certain what something does before you use it, you should at a minimum go through the necessary steps to be able to make an informed decision, otherwise it's just reckless.

load more comments (2 replies)
load more comments (3 replies)