Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Is your feature request related to a problem? Please describe.
I have a client who is giving me PDF magazines to upload to their site.
Describe the solution you'd like
I would like an easy way to add a pdf file and a preview of the front cover.
Describe alternatives you've considered
I end up following this process:
Here is a 4 minute video I made showing the process: https://youtu.be/GI9EJJmzEuI
Yes, placing PDF the expected way is a too complicated for the average user.
As mentioned there is a built-in automatic cover image generation for PDF files but that works only if the server uses imagick. But even in that case it is not straightforward to show them up using GB. In that case why actually generating cover images automatically?
Another solution might be the "file" block type but that just places a text link and a DL button.
Or one could consider to use PDF-viewing services but those send cookies...so you need to update your cookie-policy in advance...
Would be really nice to solve all that with a toggle called "show cover" in the right sidebar for the file block type. That way there are no cookies involved and the average user does not get lost looking for the link while needing to click 5-6 times here and there.
It seems like a mistake not to make use of PDF thumbnails, since WordPress is already generating them. It really shouldn't require two steps to insert a PDF thumbnail that links directly to the PDF. In the Classic Editor you can select a thumbnail size when inserting a PDF (at least, you can if you have the Display All Image Sizes plugin installed).
You can't use an image block for PDFs because the PDFs don't show up at all in the image block (reasonably, I suppose, given they are not images, but tweaking that block to allow PDFs in addition to images could be a solution).
That makes the File block pretty much the only option for inserting a PDF. I tried inserting the PDF thumbnail as an inline image in a file block. The result is horrible and it requires too many steps.
I ended up creating an ACF block to display PDFs with their thumbnails, and that will work fine for me, but somehow, with 15 gazillion different embed blocks (way more complexity than the classic editor), we don't have one for "document."
Many of my clients produce hundreds of PDFs and want them on their websites. They shouldn't have to go through multiple steps to add a linked thumbnail of the document to a page or post. It wasn't optimal in the classic editor, but it's a veritable nightmare now, and an example of a place where the block editor provides less functionality than the classic editor.