Total Pageviews

Showing posts with label confluence. Show all posts
Showing posts with label confluence. Show all posts

Wednesday, December 12, 2012

Numbered Headings in Confluence

Ever wanted to have numbered headings in Confluence? Either on the wiki page or in PDF exports?
The Numbered Headings plugin can do this.
In its simplest form you just go with the default values and get decimal numbers prefixing the headings.


The plugin offers a variety of options and I highly recommend to read the documentation.
Really awesome is that you now have numbered headings in PDF exports, so readers or reviewers of the PDF version can refer to the numbers instead of citing the whole heading.

Tuesday, December 11, 2012

Generating a title page in Confluence PDF export

Well, in a previous posting I already mentioned the possibility to generate a great looking PDF export title page for a wiki page created in Confluence Wiki.
Unfortunately the article mentioned in the posting was written in german. So here is - in short - a manual in english to get great looking PDF exports.
The steps described here are tested and verified in Confluence 4.1.9. I expect it to work with newer Confluence versions but there is no guarantee.

Step 1: Define the user macro in Confluence that defines the dynamic content of the title page



The code in the template textfield:
 
 ## Body processing: Selected body processing option
 ## Output: Selected output option  
 ##  
 ## Developed by:   
 ## Date created:   
 ## Installed by:  
 ## @param Titel:required=true|type=string|desc=Dokumenttitel  
 ## @param Thema:required=true|type=string|desc=Unterthema des Dokuments  
 ## @param Autor:required=true|type=string|desc=Dokument Autor  
 ## @param Datum:required=true|type=string|desc=Dokument Datum  
 ## @param Version:required=true|type=string|desc=Dokument Version  
 <style type="text/css">  
 .KonzeptTitel:before { content: '$paramTitel'; }  
 .KonzeptThema:before { content: '$paramThema'; }  
 .KonzeptAutor:after { content: '$paramAutor'; }  
 .KonzeptDatum:after { content: '$paramDatum'; }  
 .KonzeptVersion:after { content: '$paramVersion'; }  
 </style>  

Step 2: Declare a custom PDF Layout for exporting the title page

You can change the PDF Layout either globally or local for each space. In this example the space version is used.
In Confluence go to

Space - Browse - Space Admin - PDF Layout

and edit the section

PDF space export title page.

Enter the following content:

 <div style="text-align:center; padding:0px; padding-top: 50px;">  
 <img src="/download/attachments/3407974/Logo.jpg" width="70%" height="70%"/>  
 </div>  
 <div style="padding:0px">  
  <div class="KonzeptTitel pdfTitelblattTitel"></div>  
  <div class="KonzeptThema pdfTitelblattThema"></div>  
  <span class="pdfTitelblattText" style="display:inline-block; width:30mm; margin-bottom:2mm; padding-left: 200px;"><b>Autor:</b></span>  
  <span class="KonzeptAutor pdfTitelblattText"></span><br/>  
  <span class="pdfTitelblattText" style="display:inline-block; width:30mm; margin-bottom:2mm; padding-left: 200px"><b>Datum:</b></span>  
  <span class="KonzeptDatum pdfTitelblattText"></span><br/>  
  <span class="pdfTitelblattText" style="display:inline-block; width:30mm; margin-bottom:2mm; padding-left: 200px"><b>Version:</b></span>  
  <span class="KonzeptVersion pdfTitelblattText"></span><br/>  
  <br/>  
 </div>  

The file Logo.jpg is an image attachment somwewhere in the space. This image appears on top of the title page in the PDF export. You can get the url of the attached image when you go to the page where the image is attached and click on Tools - Attachments and then on the image you would like to see on the title page.

Step 3: Declare a custom PDF stylesheet for the PDF layout

The above layout references CSS stylesheets you must declare.
Still in the Space Admin section click on PDF Stylesheet and Edit PDF Export Stylesheet
Enter the following code:
 
@page  
 {  
 @top-right  
   {  
    content: page:title;  
   }  
 @bottom-left  
   {  
     content: element(Datetime);  
     font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;  
     font-size: 8pt;  
   }  
 @bottom-right  
   {  
     content: "Page " counter(page) " of " counter(pages) ;  
     font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;  
     font-size: 8pt;  
   }  
 @bottom-center  
   {  
     content: "Copyright © 2012, My Company LTD";  
     font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;  
     font-size: 8pt;  
     color:#595959;  
   }  
 }  
 .KonzeptTitel {   
 font-size: 36px !important;  
 text-align: center;  
 padding-top: 150px !important;  
 }  
 .KonzeptThema {   
 font-size: 24px !important;  
 text-align: center;  
 padding-top: 100px !important;  
 padding-bottom: 200px !important;  
 }  
 .KonzeptAutor {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .KonzeptDatum {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .KonzeptVersion {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .pdfTitelblattText {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .noprint  
 {  
 display: none ;  
 }  
 div.pagebreak  
 {  
   page-break-before:always;  
 }  
 .pagetitle h1 { display: none; }  

This stylesheet declares the CSS definition that was already mentioned in step 1 and 2. Furthermore it adds page numbering at the bottom (right) of the page and adds a footer at the bottom (center).
Customizing PDF exports is described in detail on this official Confluence documentation.

Step 4: Use the macro in a wiki page

The last thing to do is to insert the macro in a confluence page. Choose the macro with name konzept from the macro browser and fill in the required fields.
The following screenshot shows an example:

That's it.
One important thing to mention: You will not get the title page in your export using the PDF export from the page tools. It only works when using the PDF export method of the space.
Click on Advanced - PDF Export and select the page you would like to export. The resulting export should look something like this:



Sunday, November 25, 2012

Remove the page title in Confluence PDF export


Confluence always adds a page title when you export a page to PDF format.
If you want to get rid off the title do the following:

Go to

 Browse -> Space Admin -> Look and Feel -> PDF Stylesheet -> PDF Export Stylesheet -> Edit  

and add the following line:

 .pagetitle h1 { display: none; }  

Now PDF exports don't show the title anymore.

Thursday, November 22, 2012

Pagebreaks in Confluence PDF Export

It is often necessary to export a wiki page to PDF so managers, customers or other people who can't (or don't want to) access the wiki can read documents.
One thing that embarrasses me the most is that you don't have control over page breaks in Confluence PDF exports. There is - at least to my knowledge - no predefined macro available.
But there is a community macro which solves the problem. Take a look at the pagebreak user macro and try it.
With this macro you are in full control over page breaks in PDF exports.

Making Screenshots with Greenshot under Windows

I don't think I have high requirements for a good screenshot tool but Greenshot is by far the best one I have ever used.
It even has plugins for Jira and Confluence. Moreover it is free to use even in commercial environment. Cool :-)

Thursday, August 16, 2012

Confluence Wiki PDF Export and generating a title page

Sometimes you have the requirement to export docs written in Confluence as PDF so customers who don't get access to your wiki can read it.
Often your company has guidelines for publishing documents to the outside (or for customers).
Confluence doesn't generate a title page as default when you do a single page export or a space export as PDF.
This article (sorry, only in german) describes how to achieve this in a few steps.
It only works using the space export to PDF not the single page export.
The author has forgotten to include the CSS styles for the title page so I will publish mine as a starting point.


 .KonzeptTitel {   
 font-size: 36px !important;  
 text-align: center;  
 padding-top: 150px !important;  
 }  
 .KonzeptThema {   
 font-size: 24px !important;  
 text-align: center;  
 padding-top: 100px !important;  
 padding-bottom: 200px !important;  
 }  
 .KonzeptAutor {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .KonzeptDatum {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .KonzeptVersion {   
 font-size: 16px !important;  
 text-align: left;  
 }  
 .pdfTitelblattText {   
 font-size: 16px !important;  
 text-align: left;  
 }  
Hope this helps somebody.

Saturday, May 12, 2007

Running Confluence and Jira in the same JBoss AppServer


I recently wanted to get rid off several Standalone distributions of web applications hosted on my server at home. Each web application is using its own Tomcat Servlet container and is consuming memory and cpu due to the fact that each container is running in its own JVM.
Jira was already running on my JBoss 4.0.4GA instance and I wanted to deploy Confluence 2.5.1 in the same instance. It turns out to be not that easy, because there are a few problems with the classloading mechanism JBoss is using.
But after a few minutes I found the solution on Confluence great documentation site. The comments from Lindsay Smith and Gerald MacKenzie in this article gave me the hints about what to do to run both software products in a single JBoss instance.
Here we go (For a complete list of tasks for upgrading or installing Confluence take a look at Atlassians Homepage. The following steps describe only the procedure to build a Confluence WAR archive that is deployable in a JBoss container next to an existing JIRA WAR archive!):
  1. Unpack the new confluence WAR version in a directory called $NEW_CONFLUENCE_INSTALL_DIR
  2. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/classes/log4j.properties
  3. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/commons-logging.jar
  4. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/log4j.jar
  5. Create the file $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/jboss-web.xml with the following content
     <?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE jboss-web PUBLIC-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">  
     <jboss-web>  
     <class-loading java2ClassLoadingCompliance="false">  
          <loader-repository>  
               com.example:loader=unique-archive-name         
               <loader-repository-config>  
                    java2ParentDelegation=false  
               </loader-repository-config>       
          </loader-repository>  
     </class-loading>  
     <context-root>/confluence</context-root>  
     </jboss-web>  
    
  6. Build the Confluence WAR archive using the build script.

Sunday, March 18, 2007

Running Confluence behind Apache2

I decided to run my personal Confluence installation behind the Apache2 server running on my Debian Linux box using the mod_proxy configuration. I followed the instructions on Atlassians documentation pages (When using Debian it is described in the Jira docs) but ran into a problem afterwards.
Confluence was not accessible and I received a "Permission Denied" error when accessing confluence over HTTP (http://quebbemann.kicks-ass.net/confluence/).
The solution was to enable the Apache module proxy_http:
a2enmod proxy_http
After a Apache restart everything worked as expected!