[NEW PLUGIN] Pdf Viewer

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by Tata » Fri Dec 09, 2016 3:24 pm

Ah, yes, I understand. And well, I don't know how and from where one more space has been added in the file name. Not it works. Thanks.
But the problem with reduced width remains partially.
[ external image ] [ external image ] [ external image ] [ external image ]
Extending the class in stylesheet perspectively to

Code: Select all

#pdf_container, #pdf_container_1, #pdf_container_2, #pdf_container_3, #pdf_container_4, #pdf_container_5, #pdf_container_6, #pdf_container_7, #pdf_container_8, #pdf_container_9, #pdf_container_10 {
  width:100% !important;
  height: 782px !important;
}
I'll look in index.php if the "_1" is necessary. If it's not, it would be simpler.
EDIT
Probably not. the counter is used deeper in the function code

Code: Select all

$id="pdf_container".($pdfviewer_count>0?"_".(string)$pdfviewer_count: "");
      ++$pdfviewer_count; 
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by cmb » Fri Dec 09, 2016 3:59 pm

Tata wrote:I'll look in index.php if the "_1" is necessary. If it's not, it would be simpler.
Well, a CSS class could be added for the <iframe>. Or, if there are no other IFrames on the site, you could do:

Code: Select all

iframe {
  width: 100% !important;
  height: 782px !important;
}
Or you could embed the plugin call in a div with a CSS class:

Code: Select all

<div class="pdfviewer-container>{{{pdfviewer('filename.pdf')}}}</div>
and style:

Code: Select all

.pdfviewer-container iframe  {
  width: 100% !important;
  height: 782px !important;
}
Christoph M. Becker – Plugins for CMSimple_XH

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by frase » Fri Dec 09, 2016 4:00 pm

Try this.
Not tested!

Code: Select all

*[id^='pdf_container']{
    [css here]
}

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by cmb » Fri Dec 09, 2016 4:05 pm

frase wrote:Try this.
Not tested!

Code: Select all

*[id^='pdf_container']{
    [css here]
}
Nice! :)
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by Tata » Fri Dec 09, 2016 4:30 pm

Simple and effective.
Have a look HERE
Anyway - the option have a viewer-icon added to a link would be very nice.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by frase » Fri Dec 09, 2016 4:38 pm

Fine.

There is a problem in source-code in browser. Have a look:
<link rel="stylesheet" type="text/css" href="./templates/newresponsive/extended.css";?>

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by Tata » Fri Dec 09, 2016 4:46 pm

Thanks, just a typo. But still, looking on the first expanded dokcument, there is the real width twice. There is the scrollbar on the bottom because of doubled necessary width.
How is it with nested "expands"?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by frase » Fri Dec 09, 2016 5:00 pm

Thats a wide table in PDF-document on bottom named: "návrh učebného programu"

;)

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] Pdf Viewer

Post by Tata » Fri Dec 09, 2016 5:42 pm

I see now. I have not scroll till the ened.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

simpleSolutions.dk
Posts: 155
Joined: Thu Oct 06, 2011 7:00 am

Re: [NEW PLUGIN] Pdf Viewer

Post by simpleSolutions.dk » Fri Dec 09, 2016 11:36 pm

PDF Viewer creates a new ID for each viewer. The included CSS file contains only 2 definitions, however if the number of viewers of the page is greater then 2 then it is necessary to add subsequently css definitions like #pdf_container_2, #pdf_container_3 etc.
With installed CMSimple Mobile it is necessary to define additional css ID's for mobile devices: pdf_container_mobile, pdf_container_1_mobile and so on.

I hope that this clarifies some of the above posts

Post Reply