crazytoon's avatar

PDF creation cuts off content on mobile

I am using barryvdh/laravel-snappy to create PDFs and it works great on desktop. However, when I view the same pdf, it seems to only render whatever shows on the screen. So if the pdf is multiple page, on ipad it only shows part of the first page. On iphone, it only shows partial first page (less than ipad due to lack of screen space).

Does anybody know why this is happening and how to fix it? TIA!

0 likes
6 replies
Cronix's avatar

Are you saying you can't scroll to see more? How are you viewing it? I mean is this in a laravel view, or viewing a standalone pdf file?

crazytoon's avatar

I see whatever loads (viewable) on the screen and nothing else. its a laravel view which is used to create the pdf file and shown "inline".

Cronix's avatar

So you can't scroll around to see the rest?

crazytoon's avatar

Nm... looks like it was wrapped in iframe which was restricting it on mobile only. Out of iframe it works fine.

jlrdw's avatar

Have you tried a media query for mobile view creation. But proper viewport setting should work. Also look at package instructions you are using to create the pdf.

I haven't used, but look at PDF.js viewer.

Please or to participate in this conversation.