My problem is, everything is fine opening PDFs using my browsers, until I uploaded a pdf with a form inside. Then, if I embed it, it returns a blank page. But the other pdfs with forms open normally. Please see my code below:
<object data="{{ asset($test->file_path) }}" type="application/pdf" width="100%" height="100%">
<embed src="{{ asset($test->file_path) }}" type='application/pdf'>
<center>
<a href="{{ route('download.test', ['id' => $test->id]) }}" class="btn btn-primary">Please click here to view</a>
</center>
</object>
Note: I've also tried to use <iframe>
but still returns blank page.
option1:
Renamed my file that has #
sign. And everything should work fine.
option2:
Use urlencode
if needed.
If the fillable fields in a PDF show as blank after getting filled in, the PDF will need to be printed to a new PDF to resolve this issue. This is typically caused when the PDF is filled using something other than Acrobat (i.e., a web browser or other PDF editing software).
HTML's object tag is the first way to embed PDF files. In the below example, the pdf file will be displayed on a web page, which is an object. In addition to embedding a pdf file into a webpage, the object tag can embed ActiveX, Flash, video, audio, and Java applets.
This is due to a recent Chrome update that prevents the in browser view of the PDF. You can change Chrome's settings so the PDF downloads and opens in Acrobat Reader.
The easiest way to put PDF in an HTML document is using the <a> tag with its href attribute. You need to add the URL or the reference link of your PDF file to the element.
<a href="{{ route('download.test', ['id' => $test->id] ,['target'=>'_blank']) }}" class="btn btn-primary">Please click here to view</a>
It's late, and I'm tired, so apologies if I misread the question.
I noticed that the PDF is hosted on a site that doesn't support HTTPS. It showed a blank page if it was embedded on a site using HTTPS, but worked fine when it was using HTTP.
I think you need to either move the PDF to a site that supports HTTPS or make the site hosting the PDF start using HTTPS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With