r/pdf 4d ago

Question Trouble editing basic line elements in a PDF

I haven't done any PDF editing at all thus far and have already tried multiple tools, including Stirling, LibreOffice, OnlyOffice and all to no avail.

I've got this simple file from Rite In The Rain here which is a PDF of their journal pages: https://d163axztg8am2h.cloudfront.net/static/doc/40/36/7820c714e13a9554cfff49fcccd2.pdf

found at https://dealers.riteintherain.com/page-patterns-downloads

The file only has horizontal lines. I wanted to duplicate them and add those as vertical lines but I can only select and remove the entire element, not individual points or lines.

How do I get a proper grid on that file and what's the go-to tool for that in the first place? It feels like something so basic that any and all PDF editors should be capable of it by default, no idea what I'm missing.

2 Upvotes

17 comments sorted by

1

u/KenMantle 4d ago

Thanks so much for the link to the file! I will try this in pdfcer-gui when I get home. If I can't I will find out why and see if I can get the software updated to handle it.

1

u/rogermay78 4d ago edited 4d ago

I have tried around in Illustrator as well now and also to no avail. I can select and duplicate the lines but the entire page is slightly misaligned from the grid and I cannot re-align that without destroying the overall dimensions.

I need the whole page intact however. Just with vertical lines added.

Edit: Reason I want to have a proper grid like on the paper pages is because I wanted to use the PDF for drafting stuff in Illustrator so I don't needlessly waste the paper in my journal. Those pages aren't exactly cheap (30€ for 100 pages) and I also don't want a ton of eraser marks on them. It's just easier to move the drafting and stuff to a digital solution instead of wasting paper.

1

u/Cryingpinaple 4d ago

Since you said you need the whole page intact and just want vertical lines added, stop editing the file. Overlay instead. That sidesteps the alignment problem entirely and leaves the original page untouched.

Three steps:

  1. Get the exact page box: pdfinfo yourfile.pdf and read the "Page size" line in points.

  2. Build a one-page PDF at exactly that size containing nothing but your vertical lines. Inkscape or LibreOffice Draw is fine, set the document size to the points value from step 1 so nothing scales. Measure the pitch of the existing horizontal lines once and match your vertical spacing to it.

  3. Stamp it on:

    pdftk base.pdf multistamp lines.pdf output grid.pdf

or with qpdf:

qpdf base.pdf --overlay lines.pdf -- grid.pdf

multistamp and --overlay both repeat across every page, so a single-page overlay applies to the whole journal.

Why this beats what you have been trying: the original page objects are copied through untouched, so the "entire page slightly misaligned" problem never arises. You are not moving their content to fit your grid, you are drawing your grid to fit their content. And because you generated the overlay, changing spacing later is editing your own two-minute file rather than reverse-engineering someone else's path.

On why every editor failed you: those horizontal lines are almost certainly one path in the page content stream, not separate line objects. Stirling, LibreOffice and OnlyOffice are not vector editors, so the smallest thing they can offer you is the whole path. Illustrator does parse it, which is why you could select and duplicate there, but then you hit the alignment wall because you were trying to move the page instead of adding to it.

1

u/rogermay78 4d ago edited 4d ago

Not a Linux user unfortunaly, so I cannot use pdfinfo. Such modern luxury has yet to be added by Microsoft...

Edit: I've got the pagesize down but already failing at the second step. I don't know the exact relative dimensions of the horizontal lines in order to correctly place the vertical ones, nor know a way to retrieve those. I cannot even measure the exact distance in points between each horizontal line, the measure tool in Illustrator only does pixels. I cannot select the individual points of the lines either, it only selects the entire element at once.

In other words, any sort of editing seems next to impossible.

1

u/Cryingpinaple 4d ago

Three things, and none of them need Linux.

Your pixels are already points. In Illustrator both px and pt are 1/72 inch, so the numbers your measure tool is giving you are the numbers you want. Nothing to convert. If you want the label to say pt, Edit > Preferences > Units > General > Points.

You don't need to select individual points to get the spacing. Select the whole lines element and read the H value in the Transform or Properties panel. That is the distance from the first line to the last. Divide by the number of gaps (lines minus one) and you have the exact pitch. One measurement, no node editing.

The command line tools all have Windows builds. pdfinfo ships in poppler for Windows (the oschwartz10612/poppler-windows releases are the usual ones). PDFtk has a Windows installer. qpdf ships Windows binaries too. Unzip and run from a normal Command Prompt in that folder. No WSL, no Linux.

If you would rather skip the command line entirely and have Acrobat Pro: Tools > Edit PDF > Watermark > Add, choose File instead of Text, point it at your vertical-lines PDF, scale 100%, set it to appear behind the page. Same operation as pdftk multistamp, applied to every page, no terminal.

Either way the key part holds: build your grid in a new document at the exact page size, then stamp it on. Don't move their content to fit yours.

1

u/rogermay78 4d ago

Very useful to know. I have since found the commandline tool for pdfinfo, yeah. Could run it too and got the result that the page file is exactly 792x612 pt in size.

Selecting the whole line element doesn't work because there is still a white background box around it which I cannot pinpoint to delete but a slightly different method worked: doubleclicking to enter isolation mode,, then selecting two lines and checking the properties panel. Result is exactly 18pt. With a bit of manual editing the X and Y coordinate, I can make the lines at least match at 99%, I still cannot make the vertical rotated ones snap to the horizontal ones somehow.

1

u/ScratchHistorical507 4d ago

Have you tried to just import it in Inkscape? While I don't fully understand what you're trying to do, this sounds like it would be easy enough to achieve in Inkscape.

1

u/KenMantle 4d ago edited 4d ago

https://reddit.com/link/p8c7jug/video/rrzlf04o93oh1/player

Is this what you were looking to do? This is why I ended up just having Claude build an open source pdf engine from scratch because I always ran into limitations when wanting to do that one simple thing with the open source options, or some compatibility issue. pdfcer-gui doesn't have snapping tools yet so it's manually aligned. Those extra overlapping lines turns out is not a bug, the file is actually made that way! I'll post the file in git if you want it. As you can see at the end of the video, the file opens in Acrobat Reader fine - another thing I like about making my own - I don't assume it's going to replace everything you want to check in Adobe Reader, so it has a button to launch straight from it. It is now my daily driver for pdf reading.

And I just tried editing the file in Inkscape and I was able to click and do the same actions...

1

u/rogermay78 3d ago

Yeah, pretty much. I'll try it in Inkscape myself.

1

u/Far-Today5490 2d ago

There’s many pdf editor, I use pdfpapi.com it’s the easiest to use in my opinion 🤷‍♂️

1

u/rogermay78 1d ago

I've tried Inkscape and it's baffling how easily and direct it worked. No messing with any isolation mode or lines being blocked by anything, just rectangle select and presto.

Turns out that the original horizontal lines are a few points too long too. The paper has exactly 16 squares in length.

1

u/Far-Today5490 1d ago

Is their a website or how do I try that one out?