PDF View

Get help developing custom BBCodes or request one.
User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

PDF View

Post by awr » Mon Oct 07, 2019 10:13 am

BBCode

Code: Select all

[pdf]{URL}[/pdf]
HTML

Code: Select all

<iframe src="{URL}" style="width:850px; height:800px;" frameborder="0"></iframe>
Help

Code: Select all

pdf
I use these bbcodes in my website for PDF view. Codes run smoothly on the computer, but cannot be viewed on mobile devices.
Image on computer
Image on computer
Image on mobile
Image on mobile
"Aç" means "open". When I click open firstly downloading the file can be accessed by opening it from where it was downloaded.
What should I do to view it directly on a mobile device like on computer?

Thanks.

User avatar
david63
Registered User
Posts: 16540
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: PDF View

Post by david63 » Mon Oct 07, 2019 10:18 am

Does your mobile device have a pdf reader installed and configured correctly?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
3Di
Former Team Member
Posts: 14225
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PDF View

Post by 3Di » Mon Oct 07, 2019 10:22 am

<iframe src="{URL}" style="width:850px; height:800px;" frameborder="0"></iframe>

try
<iframe src="{URL}" style="width="100%" height="800"></iframe>

Or use this extension if you want to use your attachments PDF files
https://phpbbstudio.com/extensions/google-pdf-autoembed

Demo: https://phpbbstudio.com/viewtopic.php?f=2&t=59
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Mon Oct 07, 2019 11:59 am

david63 wrote:
Mon Oct 07, 2019 10:18 am
Does your mobile device have a pdf reader installed and configured correctly?
Yes of course. Adobe acrobat reader is installed but the result is unfortunately the same. If you have a different application to recommend, I can try again.

Thanks.

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Mon Oct 07, 2019 12:05 pm

3Di wrote:
Mon Oct 07, 2019 10:22 am
<iframe src="{URL}" style="width:850px; height:800px;" frameborder="0"></iframe>

try
<iframe src="{URL}" style="width="100%" height="800"></iframe>

Or use this extension if you want to use your attachments PDF files
https://phpbbstudio.com/extensions/google-pdf-autoembed

Demo: https://phpbbstudio.com/viewtopic.php?f=2&t=59
I set up extension and tried this code, but unfortunately nothing changed.

Code: Select all

try
[c]<iframe src="{URL}" style="width="100%" height="800"></iframe>[/c]

User avatar
3Di
Former Team Member
Posts: 14225
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PDF View

Post by 3Di » Mon Oct 07, 2019 9:15 pm

awr wrote:
Mon Oct 07, 2019 12:05 pm
tried this code, but unfortunately nothing changed.
Ooops, that code is indeed buggy. Sorry.

Let's try again

[pdf]{URL}[/pdf]

This code uses HTML5 embed tag

Code: Select all

<style>
.studio-pdf {
	position: relative;
	height: 0;
	padding-top: 25px;
	padding-bottom: 56.25%; /* 16:9 */
}

.studio-pdf embed {
	border: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 800px;
}
</style>
<div class="studio-pdf"><embed src="{URL}" type="application/pdf"></div>
Tested, on phpBB 3.2.8.
Mobile view firefox
Mobile view firefox
desktop firefox
desktop firefox
desktop IE11
desktop IE11
Last edited by 3Di on Tue Oct 08, 2019 9:08 pm, edited 1 time in total.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Tue Oct 08, 2019 6:34 am

3Di wrote:
Mon Oct 07, 2019 9:15 pm
Let's try again

[pdf]{URL}[/pdf]

This code uses HTML5 embed tag

Code: Select all

<style>
.studio-pdf {
	position: relative;
	height: 0;
	padding-top: 25px;
	padding-bottom: 56.25%; /* 16:9 */
}

.studio-pdf embed {
	border: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
</style>
<div class="studio-pdf"><embed src="{URL}" width="100%" type="application/pdf" height="800"></div>
Where should I add this code? I tried adding it to a few places but nothing changed.

User avatar
3Di
Former Team Member
Posts: 14225
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PDF View

Post by 3Di » Tue Oct 08, 2019 7:18 pm

Man, that`s a BBcode!

(see again the post, the code has changed a bit)
Attachments
2019-10-08 21_23_28-BBCodes.png
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Wed Oct 09, 2019 5:44 am

3Di wrote:
Tue Oct 08, 2019 7:18 pm
Man, that`s a BBcode!

(see again the post, the code has changed a bit)
I added same place. These codes took into a frame the image neatly both of on computer and mobile devices.
comp.jpg
but it doesn't change to view of mobile devices.
mobile.jpg

User avatar
3Di
Former Team Member
Posts: 14225
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PDF View

Post by 3Di » Wed Oct 09, 2019 8:12 pm

Try changing mobile's browser.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Wed Oct 09, 2019 10:08 pm

3Di wrote:
Wed Oct 09, 2019 8:12 pm
Try changing mobile's browser.
I tried to changed 4 differents browser's on mobile.
Microsoft edge
Microsoft edge
Samsung internet browser
Samsung internet browser
'Bu eklenti desteklenmiyor' means 'this extension unsupported'
Firefox
Firefox
Firefox beta for android
Firefox beta for android

User avatar
3Di
Former Team Member
Posts: 14225
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PDF View

Post by 3Di » Wed Oct 09, 2019 10:55 pm

You might want to download and install a PDF reader? https://play.google.com/store/search?q= ... der&c=apps

I use only this Browser, for Android: https://play.google.com/store/apps/deta ... le.android
And it works by my side.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Thu Oct 10, 2019 5:47 am

3Di wrote:
Wed Oct 09, 2019 10:55 pm
You might want to download and install a PDF reader? https://play.google.com/store/search?q= ... der&c=apps

I use only this Browser, for Android: https://play.google.com/store/apps/deta ... le.android
And it works by my side.
I had a pdf reader on my phone. I tried installing another one on your advice. I've also tried your recommended browser for android, the result likes firefox. So the image doesn't exist again.

User avatar
awr
Registered User
Posts: 19
Joined: Fri Jun 11, 2010 8:14 am
Location: İstanbul/ Türkiye

Re: PDF View

Post by awr » Thu Oct 10, 2019 7:06 am

Editing the code in this way solved the problem.
BBCode

Code: Select all

[pdf]{URL}[/pdf]
HTML

Code: Select all

<div style="position: relative; overflow: hidden; height: 0; padding-bottom: 56.25%; /* 16:9 */">
<object style="position: absolute; left: 0; top: 0; width: 100%; height: 100%" data="//docs.google.com/viewer?url={URL}&embedded=true"></object>
</div>
Help

Code: Select all

pdf
images of mobile device
images of mobile device
images of computer
images of computer

Thank you for your help 3Di.

User avatar
John connor
Registered User
Posts: 2238
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: PDF View

Post by John connor » Thu Oct 10, 2019 7:09 am

I can't really help on your PDF display issue other than say perhaps you have a blocker of some sort on in your phone or what ever.

What I am here to say is that a PDF can be inherently dangerous in terms of malware or a canary token that will log IP addresses from anyone that views the PDF.
Last edited by John connor on Thu Oct 10, 2019 7:15 am, edited 1 time in total.

Post Reply

Return to “Custom BBCode Development and Requests”