[xwiki-users] Missing border and background color of "code" macro in exported pdf
Hi, i use the macro "code" to highlight code blocks in the text. On export (e.g. as pdf) only the text is colored and has another font, but there is no border or background color, like in the web view. The text before and after the code block is also not quite nice styled. It is indented wich is not good for reading. How can i change the style of the code blok and surrounding text in the exported document? With best regards Alina -- ----------------------------------- SOURCEPARK GmbH B.Sc. Alina Kupgisch Partner der Allianz für Cyber-Sicherheit des Bundesamtes für Sicherheit in der Informationstechnik (BSI) Hohenzollerndamm 150, Gebaeude 7 14199 Berlin Tel: +49 (0)30/398 068 30 Fax: +49 (0)30/398 068 39 e-mail: alina.kupgisch@sourcepark.de WWW: www.sourcepark.de ----------------------------------- SOURCEPARK GmbH Sitz der Gesellschaft: Berlin Handelsregister: Amtsgericht Berlin-Charlottenburg, HRB 80254 Geschäftsführer: Matthias Barmeier, Harald Dürr ----------------------------------- Wichtiger Hinweis: Die vorgenannten Angaben werden jeder E-Mail automatisch hinzugefügt und lassen keine Rückschlüsse auf den Rechtscharakter der E-Mail zu. Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.
Details about changing the rendering of the PDF are documented here: http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Configuration#HCustomizi... In your case to change the background color the easiest solution is probably to attach a file named "pdf.css" to the page XWiki.DefaultSkin with the contents: .box { background-color: #CCCCCC; } or whatever color you would like to have in print. I have to admit that I could not get a border around the box with a similar CSS declaration; also I could not fix the indentation of the text around the block; actually it should not be indented ... Adding a separate p { text-indent:0; } to the pdf.css fixes that, but I am not sure if this does not has other side effects hope it helps anyway Clemens
Hi,
i use the macro "code" to highlight code blocks in the text. On export (e.g. as pdf) only the text is colored and has another font, but there is no border or background color, like in the web view. The text before and after the code block is also not quite nice styled. It is indented wich is not good for reading.
How can i change the style of the code blok and surrounding text in the exported document?
With best regards Alina
About the missing border: I forgot that there is this bug: http://jira.xwiki.org/browse/XWIKI-13163 "Border style is not displayed, when we specify it on the pdf.css" the workaround described in the issue works well, even though it is quite a a bit of copy & paste; the result looks like: .box { background-color: #CCC; border-top-style:solid; border-bottom-style:solid; border-left-style:solid; border-right-style:solid; border-top-color:#444; border-bottom-color:#444; border-left-color:#444; border-right-color:#444; } p { text-indent:0; }
Details about changing the rendering of the PDF are documented here:
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Configuration#HCustomizi...
In your case to change the background color the easiest solution is probably to attach a file named "pdf.css" to the page XWiki.DefaultSkin with the contents:
.box { background-color: #CCCCCC; }
or whatever color you would like to have in print.
I have to admit that I could not get a border around the box with a similar CSS declaration; also I could not fix the indentation of the text around the block; actually it should not be indented ...
Adding a separate
p { text-indent:0; }
to the pdf.css fixes that, but I am not sure if this does not has other side effects
hope it helps anyway Clemens
Hi,
i use the macro "code" to highlight code blocks in the text. On export (e.g. as pdf) only the text is colored and has another font, but there is no border or background color, like in the web view. The text before and after the code block is also not quite nice styled. It is indented wich is not good for reading.
How can i change the style of the code blok and surrounding text in the exported document?
With best regards Alina
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Alina Kupgisch -
Clemens Klein-Robbenhaar