PDFreport - where is the stylesheet for this plugin?

More
6 months 3 weeks ago #194813 by Sweden
Hi there,

What stylesheet does the PDFreport plugin use? I thought it was either the base.css or pdfreport.css file, but they don't seem to have any effect on the PDF's. I tried to move the pdfreport.css to several different locations, but I guess I haven't found the right place… help section on GitHub says it should be moved to "the files directory of the template", but I'm not sure where that is.

So my questions are:
  1. What stylesheet does this plugin use as default?
  2. Where should I put the pdfreport.css?

LS version is 3.22.7+200225

Please Log in to join the conversation.

LimeSurvey Partners
More
6 months 3 weeks ago - 6 months 3 weeks ago #194817 by Joffm

"the files directory of the template", but I'm not sure where that is.

upload/themes/survey/[theme_name]/files

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 months 3 weeks ago by Joffm.
The following user(s) said Thank You: Sweden

Please Log in to join the conversation.

More
6 months 3 weeks ago #194822 by Sweden
Thanks, but it doesn't seem to change anything when I place the pdfreport.css file there (neither in the 20+ other folders I have tried). Very strange. I wonder if I have to rename it or something else? :unsure:

Please Log in to join the conversation.

More
6 months 3 weeks ago - 6 months 3 weeks ago #194823 by Joffm
Obviously you do something wrong that I can't see.
You don't have to change anything, only copy.

Two examples with different bg-color of the table cell <td>

1. example
.tdanswer {
  font-size:11pt;
  background-color: red;
  color:black;
/*  font-weight:bold;*/
  border: 1px solid black;
}



2. example
.tdanswer {
  font-size:11pt;
  background-color: navy;
  color:yellow;
/*  font-weight:bold;*/
  border: 1px solid black;
}



Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 6 months 3 weeks ago by Joffm.
The following user(s) said Thank You: DenisChenu, Sweden

Please Log in to join the conversation.

More
6 months 3 weeks ago - 6 months 3 weeks ago #194829 by Sweden
Thanks again for you help. I tried to change font size for h1, h2, h3 etc. (I use them on the page that is converted into PDF) Also changed background color and font size for body. None of these changes can be seen in the PDF…

Strange thing is that I changed the background color in divs in pdfreport.css and that worked! Not sure why the other changes aren't showing. I will have to play with that some more.

BTW: Do you know how to change the header in the template that pdfreport uses, e.g. change font size for the sub title for the pdf (default is {surveyname} and is inserted in the top left corner). It could also be nice to be able to insert some text in the footer, next to the page numbers.
Last edit: 6 months 3 weeks ago by Sweden.

Please Log in to join the conversation.

More
6 months 3 weeks ago #194839 by DenisChenu
PDFReport have 2 different system to generate PDF

The included tcpdf : using pdfreport.css in template/files directory
limeMpdf where you can update m a lot more things : gitlab.com/SondagesPro/coreAndTools/limeMpdf#adapt-html-and-css and have an adapted boostrap style.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: Sweden

Please Log in to join the conversation.

More
6 months 3 weeks ago #194841 by Joffm
One more word:

As you see here in the "pdfReport.php"
private function _getCss()
    {
        $oTemplate = \Template::model()->getInstance(null, $this->_iSurveyId);
        if (is_file($oTemplate->filesPath.'pdfreport.css')) {
            /* @todo : get parent */
            return file_get_contents($oTemplate->filesPath.'/pdfreport.css');
        }
        return file_get_contents(dirname(__FILE__).'/pdfreport.css');
    }

the css is taken per default from the plugin's pdfreport.css
But as it is always preferable to design the report similar to the theme you can use the folder of the theme (what I prefer).

And since this report is based on TCPDF resp. mPDF, you should read the documentation there and study some examples of TCPDF.
Furthermore you might get help in the "pdf.php" (in "application/libraries/admin")

And as Denis said, try to use "limeMpdf". But I am not fasmiliar with it.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, Sweden

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #194896 by Sweden
Many thanks to both of you ;) I'm trying to figure out how the default pdfreport plugin works so I haven't looked into limeMpdf.

I have, however, tried for many hours to find out how I can insert some text centered in the footer of the PDF (below the line where the page numbers are). I have looked through many different files, but I just can't figure out what creates the line in header/footer and the word "page" in the footer.

Anyone know where I can insert some text so it shows in the footer of the PDF?
Last edit: 6 months 2 weeks ago by Sweden.

Please Log in to join the conversation.

More
6 months 2 weeks ago #194906 by DenisChenu
Please : show a screenshot of your question setings.

To add any text inside the footer : you need limeMpdf

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: Sweden

Please Log in to join the conversation.

More
6 months 2 weeks ago #194959 by Sweden
Thanks again. PDFreport is working fine so that is not the problem. I may have to look into limeMpdf, but I was hoping that there was a shortcut to inserting just a few words in the footer (perhaps by editing the code directly?)

I'm not sure if I can ask more questions in this thread, but how can I prevent a page-break in the middle of a div or a table? Content is dynamic. I have tried a couple of things (nobr="true", page-break-inside:avoid), but that doesn't work.

Also, how can I prevent the warning message "Are you sure you want to leave this page?" (something like that) that shows when you click the "print answers" link (that are used for downloading the PDF). I don't want to disable this message completely on the last page, because it is very useful. It is only when people are clicking the link to download their PDF that it shouldn't show (because it will only confuse people since they are not leaving the page).

Please Log in to join the conversation.

More
6 months 2 weeks ago #195037 by DenisChenu
About footer : in TCPDF it's done by LimeSurvey core, you can hack LimeSUrvey.
In limeMpdf : it's done with gitlab.com/SondagesPro/coreAndTools/lime...ews/mpdf/footer.twig file. Then : you can "just" don it in your template.

About pagebreak : i already tested page-break-inside:avoid its work, but not perfect .
It's the reason why i add it only for textarea part. When there are multiple it must broke somewhere , then broke .... never at the good place.

About forced pagebreak : gitlab.com/SondagesPro/ExportAndStats/pd...r/pdfReport.php#L541



> Also, how can I prevent the warning message "Are you sure you want to leave this page?"
Not come from the plugin or LimeSUrvey : never see this.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: Sweden

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #195095 by Sweden
Thanks a lot :) and sorry for my late response.

I'm not sure what LS file I should change so the footer changes, but I will try and figure it out. I will also take a closer look at pagebreak and how to use it best - thanks for that too.
Last edit: 6 months 2 weeks ago by Sweden.

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #195122 by DenisChenu
Since you don't show anything .... how you think we can explain more ???

I already say : show a screenshot of you current question setting ....

> I'm not sure what LS file I should change so the footer changes,

gitlab.com/SondagesPro/ExportAndStats/pd...#style-and-css-usage

Then if you use limeMdf : gitlab.com/SondagesPro/coreAndTools/lime...d#adapt-html-and-css

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Last edit: 6 months 2 weeks ago by DenisChenu.
The following user(s) said Thank You: Sweden

Please Log in to join the conversation.

More
6 months 2 weeks ago #195148 by Sweden
Huh????? I wasn't being sarcastic - I actually meant thank you for pointing me in the right direction! I'm really sorry, it must be a language barrier thing. Of course I don't expect you to solve my problems without me doing anything. I usually spend hours or days before I give up and ask for help. Do you really think I would press the "Thank You" button if I didn't meant it? You have really helped me and I appreciate your great plugin. I hope that is clear now. Also thanks for the additional tips ;)

Please Log in to join the conversation.

More
6 months 2 weeks ago #195149 by DenisChenu
I ask a

DenisChenu wrote: Please : show a screenshot of your question setings.

some day ago ...

I can not help without .....

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now