? No Code Attached Yet
avatar HDInfautre
HDInfautre
6 Jan 2022

Is your feature request related to a problem? Please describe.

Inserting a pdf natively with the tinyMCE button generates a code:
<object data="0_medias/jdll.pdf" type="application/pdf" width="800" height="600">
Displaying the pdf breaks the display in a blog or in an article

Describe the solution you'd like

Make the code of the inserted pdf responsive with a button?

Additional context

avatar HDInfautre HDInfautre - open - 6 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jan 2022
avatar HDInfautre HDInfautre - change - 6 Jan 2022
The description was changed
avatar HDInfautre HDInfautre - edited - 6 Jan 2022
avatar dgrammatiko
dgrammatiko - comment - 6 Jan 2022

width="800" height="600"

You do realise that both attributes width and height are not for sizing, right?
Sizing happens with CSS and preferably classes

Pull requests are welcome

avatar brianteeman
brianteeman - comment - 6 Jan 2022

@dgrammatiko they are user editable

image

avatar dgrammatiko
dgrammatiko - comment - 6 Jan 2022
object[type="application/pdf"] {
 max-width: 100%;
.
.
.
}

The width and height are for the browser to calculate the blank space UNTILL there is something there to display, they are not for styling purposes...

avatar HDInfautre
HDInfautre - comment - 7 Jan 2022

Hi
First of all, thank you for answering me while I know that you are important developers of joomla who had little time on this kind of questions!
Yes I understand that the default value sets a frame
Yes, I know that it should be possible to solve this with css.
I would suggest adding a checkbox (responsive) as I think 90% of site builders will not know how to do this.

 h2 {background-color: coral; /* css ok */}
object[type="application/pdf"] { 
 max-width: 100%;
background-color: coral; /* css ok */
}

I tested on joomla 4 and joomla 4.1 beta3, it seems to me that there is still a problem by putting

I put h2 to be sure to apply the css!
See the test site.
https://joom41test.88h.ovh/index.php/mon-1er-article
It is not serious if you do not have the solution css, I will seek on my side another css. The question of having a button for a responsive rendering in blog and article mode, remains the main question :-)
Sorry for my bad English translation.

regards

avatar dgrammatiko
dgrammatiko - comment - 7 Jan 2022

@HDInfautre the code I gave was pseudo. The width: 100% seems the right one here
Screenshot 2022-01-07 at 12 07 04

avatar brianteeman
brianteeman - comment - 7 Jan 2022

its not max-widht but just width

avatar HDInfautre
HDInfautre - comment - 7 Jan 2022

Hi
@dgrammatiko
yes I'm purposely setting smaller values to see if the css works
@brianteeman @dgrammatiko
yes it works with "with" only

After 2 small problems, but probably not related to joomla!
1/ if I reduce the size of the article window, I have a horizontal navigation bar on the pdf!
2/ no pdf viewing on firefox android but I think I remember there may be a problem viewing on smartphone?

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: ?
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment