First, install the plugin as usual. There are several '''dependencies''':

25

27

26

* [http://www.xhtml2pdf.com/ xhtml2pdf/PISA]: The python library used to convert HTML to PDF. You can install it with ''easy_install pisa''. The version supported by this plugin is 3.0.30. Others might work (3.0.29 is known to have a bug in TOC creation).

28

* [http://www.xhtml2pdf.com/ xhtml2pdf/PISA]: The python library used to convert HTML to PDF. You can install it with ''easy_install pisa''. The version supported by this plugin is 3.0.32. Others might work (3.0.29 is known to have a bug in TOC creation).

27

29

* [http://www.reportlab.org/ ReportLab version 2.2]: This is a dependency of xhtml2pdf. If using easy_install, it should be automatically installed.

!WikiPrint exports the wiki format to HTML first, then converts the HTML to PDF using xhtml2pdf library. Links and image references in the wiki to html conversion are made as absolute URLS.

77

82

78

In order to generate the PDF, ''xhtml2pdf'' library will try to download the images from their absolute URL (exactly as your web browser would do). The ''xhtml2pdf'' library is given a temporary cookie to authenticate in behave of the user, so the conversion process will have the same permissions as the user downloading the .pdf, but '''you must make sure that the project URL is accessible locally from the trac server itself'''. Also, per #6254, the server must not require HTTP authentication when connecting (Trac must be configured use the "login" link).

83

In order to generate the PDF, ''xhtml2pdf'' library will try to download the images from their absolute URL (exactly as your web browser would do).

79

84

80

85

For example, if you access the trac project from your browser using the URL http://myserver/trac/myproject, but address of ''myserver'' is locally resolved at your workstation (via /etc/hosts or similar), and not globally known, then ''xhtml2pdf'' will fail to resolve ''myserver'' and won't be able to download the images from http://myserver/trac/myproject/. In that case, use the server IP instead.

81

86

87

'''Authentication and permissions'''

88

89

When using cookie based authentication (like AccountManager), the ''xhtml2pdf'' library is given a temporary cookie to authenticate in behave of the user, so the conversion process will have the same permissions as the user downloading the .pdf, but '''you must make sure that the project URL is accessible locally from the trac server itself'''.

90

91

Optionally, is HTTP Basic or Digest authentication is used, wikiprint can be configured to log in using '''httpauth_user''' and '''httpauth_password''' options.

92

82

93

=== Security Concerns ===

83

94

84

When setting up header, footer, style, etc. the user can select a file from the file system and preview it. This could mean a security risk, as the user might display ''/etc/passwd'' or critical files. This is not a WikiPrint problem, as anyone with TRAC_ADMIN permissions would be able to install and run a potentially insecure plugin. So, make sure you trust users with TRAC_ADMIN permissions.

* WIKIPRINT_FILESYSTEM: When setting up header, footer, style, etc. the user can enter a path to a file from the file system. In order for this to work, the user must have this ''WIKIPRINT_FILESYSTEM'' permission. Otherwise, this could mean a security risk, as the user might display ''/etc/passwd'' or critical files. This is not a WikiPrint problem, as anyone with TRAC_ADMIN permissions would be able to install and run a potentially insecure plugin. So, make sure you trust users with TRAC_ADMIN permissions, and you give WIKIPRINT_FILESYSTEM permission only to trusted users.