76 | | !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, and then absolute urls (like http://myserver/myproject/wiki/attachments/myimage.jpg) are replaced by the environment local path before converting to PDF (like c:/path/to/my/environment/wiki/attachments/myimage.jpg). This should be done automatically, with no additional settings, from the URL in the request. |
| 76 | !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 | |
| 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'''. |
| 79 | |
| 80 | 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. |