Modify styles before queXML export: what classes available ?

Mehr
3 Jahre 1 Monat her #122958 von ulysse68
ulysse68 erstellte das Thema Modify styles before queXML export: what classes available ?
Hi all!

I just discovered the new screen before the queXML export: great! It lets us customize styles, adapting for instance td.questionnaireInfo to left align the text. I tried to define a page-break before a new section:
span.sectionTitle {font-size:18pt; font-weight:bold; page-break-before:always;}
but the next question becomes blank. I tried to define this property on div.group or h3.grouptitle without success. Apart from the classes indicated in the screen, are there other classes that can be adapted? I couldn't find any list of available styles.

Thanks!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 1 Monat her #123061 von adamzammit
adamzammit antwortete auf das Thema: Modify styles before queXML export: what classes available ?
Hello!

The classes listed are all those available in the queXML export. For more details you can see the code of the queXML PDF class here: bazaar.launchpad.net/~adamzammit/quexml/.../head:/quexmlpdf.php

queXML PDF uses TCPDF to generate the PDF document. Some CSS styling will work, but not all. Also some (such as this page break CSS) may have unexpected results due to the way the queXML PDF system generates the PDF file.

For a feature like making each section appear on a new page - I'd suggest logging a feature request upstream (here: bugs.launchpad.net/quexml ) and if developed it will wind up in Lime Survey.

Adam
Folgende Benutzer bedankten sich: ulysse68

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 1 Monat her #123068 von ulysse68
ulysse68 antwortete auf das Thema: Modify styles before queXML export: what classes available ?
Thanks Adam! I'll write a feature request for queXML.

Greg

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 1 Monat her #123075 von DenisChenu
DenisChenu antwortete auf das Thema: Modify styles before queXML export: what classes available ?

adamzammit schrieb: ////
queXML PDF uses TCPDF to generate the PDF document. Some CSS styling will work, but not all. Also some (such as this page break CSS) may have unexpected results due to the way the queXML PDF system generates the PDF file.
....

I force page break in tcPDF in a plugin with:
<br pagebreak="true" />
But using tidy or CHtmlPurifier remove this br.

Then i use some complex system:

Can show code since is not public actually but :
$oPDF = new pdfReport();
        // Bad hacking to clean HTML code but leave page break
        $pdfSpecific=array('<br pagebreak="true" />','<br pagebreak="true"/>','<br pagebreak="true">','<page>','</page>');
        $pdfReplaced=array('<span>br pagebreak="true"</span>','<span>br pagebreak="true"</span>','<span>br pagebreak="true"</span>','<span>page</span>','<span>/page</span>');
        $sText=str_replace($pdfSpecific, $pdfReplaced, $sText);
        if(function_exists ("tidy_parse_string")) // Call to undefined function tidy_parse_string() in ./application/third_party/tcpdf/include/tcpdf_static.php on line 2099
        { 
            $tidy_options = array (
				'clean' => 1,
				'drop-empty-paras' => 0,
				'drop-proprietary-attributes' => 0,
				'fix-backslash' => 1,
				'hide-comments' => 1,
				'join-styles' => 1,
				'lower-literals' => 1,
				'merge-divs' => 1,
				'merge-spans' => 1,
				'output-xhtml' => 1,
				'word-2000' => 0,
				'wrap' => 0,
				'output-bom' => 0,
				'char-encoding' => 'utf8',
				'input-encoding' => 'utf8',
				'output-encoding' => 'utf8'
			);// Fix UTF8 and <br preakpage="true" />
            $sText=$oPDF->fixHTMLCode($sText,$sCssContent,'',$tidy_options); 
        }
        else
        {
            // TODO : Find the good way to use pagebreak="true", verify i page is used in tcpdf
            // ALT : explode/implode
            $oPurifier = new CHtmlPurifier();
            $oPurifier->options = array(
                'AutoFormat.RemoveEmpty'=>false,
                'Core.NormalizeNewlines'=>false,
                'CSS.AllowTricky'=>true, // Allow display:none; (and other)
                'CSS.Trusted' => true,
                'Attr.EnableID'=>true, // Allow to set id
                'Attr.AllowedFrameTargets'=>array('_blank','_self'),
                'URI.AllowedSchemes'=>array(
                    'http' => true,
                    'https' => true,
                    'mailto' => true,
                    'ftp' => true,
                    'nntp' => true,
                    'news' => true,
                    )
            );
            $sText=$oPurifier->purify($sText);
 
        }
        $sText=str_replace($pdfReplaced, $pdfSpecific, $sText);

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha