How to crack a password of a pdf file that is edit protected

I need help with using John…I made a pdf file a while ago and I password protected it from editing. I mean I was able to get inside by using microsoft print to pdf, which is a bit problematic. Adobe print to pdf stopped me, but microsoft print to pdf didn’t and I can access all layers and everything.
But I still don’t know my password and I am dedicated to getting it :smiley:
I tried using pdf2john to create the hash file and then editing that file, to leave only the hash within. Then I used John, and it worked, but it gave me empty password. Even using --show, it read “?:” and that’s it.
When I tried to use John directly on the pdf it gave me a warning: invalid UTF-8 seen reading “pdf”
and Warning: only loading hashes of type “HMAC-SHA256”, but also saw type “HMAC-SHA224”
Then it loads 43 password hashes and tries to crack, but doesn’t work.

Is there something else I should do if the pdf is not password protected but only the editing is password restricted?

I hope I made it clear :smiley:

I never tried to break through a password-protected PDF, but considering that yours doesn’t prevent reading its contents, I’d start by attempting to create a new (corresponding) .ps (i.e. Postscript) file:

pdf2ps /path/to/my.pdf

…and then use such .ps file to create a new .pdf one:

ps2pdf /path/to/my.ps new.pdf