Back again. I’ve got some comments on the PDF Viewer Component:
I’m thinking you’re potentially going to end up releasing this as an official component. And I’m commenting in again to give a little bit of feedback…
This is actually pretty cool. I like how the website background does not scroll. It does appear as though I have to use a container to define the width, but the options are nice and simple. Really the only thing that I wish that this had that it doesn’t is a way to change the background color. I could probably figure out how to target and add custom CSS in my custom code block that I use for that kind of a thing, but it would be nice if that was just a built-in part of it. But otherwise, this is slick.
You know, if I could add a function, and I don’t know how well it would work, if it were possible for something like this to understand what the size, I guess I should say aspect ratio, of the PDF is, and then it were to draw the container that the PDF renders in and keep it at the same aspect ratio, obviously assuming all pages in a PDF are the same, of course. That would be incredible.
Honestly, the biggest issue I’ve found with anything that renders PDFs is trying to correctly define the size relative to the PDF itself. And then, of course, you have to go through every different breakpoint and figure out what that is all the way down to mobile.
If there were a way for it to just see the PDF, calculate the aspect ratio, and conform itself to that shape, it would be an unbelievably great Component, bar none! And like I said, add the ability to change the background color inside the rendered area.
Anyway, yeah, I’m checking it out, using it as a part of a modal, and it’s very close to what I’d want to use. In the meantime, I’ll see about trying to target what the background is and add that CSS to define it myself.
But this is cool. The simplicity is a part of its strength!