Return-Path: Delivered-To: apmail-maven-doxia-dev-archive@www.apache.org Received: (qmail 49926 invoked from network); 17 Dec 2009 18:38:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Dec 2009 18:38:32 -0000 Received: (qmail 12650 invoked by uid 500); 17 Dec 2009 18:38:32 -0000 Delivered-To: apmail-maven-doxia-dev-archive@maven.apache.org Received: (qmail 12591 invoked by uid 500); 17 Dec 2009 18:38:32 -0000 Mailing-List: contact doxia-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: doxia-dev@maven.apache.org Delivered-To: mailing list doxia-dev@maven.apache.org Received: (qmail 12580 invoked by uid 99); 17 Dec 2009 18:38:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 18:38:32 +0000 X-ASF-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stjerman@cisco.com designates 171.71.176.117 as permitted sender) Received: from [171.71.176.117] (HELO sj-iport-6.cisco.com) (171.71.176.117) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 18:38:28 +0000 Authentication-Results: sj-iport-6.cisco.com; dkim=neutral (message not signed) header.i=none X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgFAN8IKkurR7Ht/2dsb2JhbACCKJgYpSaXLII0gXkE X-IronPort-AV: E=Sophos;i="4.47,414,1257120000"; d="scan'208,217";a="451540978" Received: from sj-core-1.cisco.com ([171.71.177.237]) by sj-iport-6.cisco.com with ESMTP; 17 Dec 2009 18:38:07 +0000 Received: from xbh-sjc-221.amer.cisco.com (xbh-sjc-221.cisco.com [128.107.191.63]) by sj-core-1.cisco.com (8.13.8/8.14.3) with ESMTP id nBHIc70D019103 for ; Thu, 17 Dec 2009 18:38:07 GMT Received: from xmb-sjc-22c.amer.cisco.com ([128.107.191.47]) by xbh-sjc-221.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 17 Dec 2009 10:38:07 -0800 Received: from 10.19.147.53 ([10.19.147.53]) by xmb-sjc-22c.amer.cisco.com ([128.107.191.47]) with Microsoft Exchange Server HTTP-DAV ; Thu, 17 Dec 2009 18:38:07 +0000 User-Agent: Microsoft-Entourage/12.23.0.091001 Date: Thu, 17 Dec 2009 11:38:06 -0700 Subject: Using Relative URLs for images. From: Steve Jerman To: Message-ID: Thread-Topic: Using Relative URLs for images. Thread-Index: Acp/SBKauGjGvw0XSkWdAyo2TDbXIA== Mime-version: 1.0 Content-type: multipart/alternative; boundary="B_3343894686_10379860" X-OriginalArrivalTime: 17 Dec 2009 18:38:07.0810 (UTC) FILETIME=[13AF2A20:01CA7F48] --B_3343894686_10379860 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Hi folks, At present Doxia (specifically the PDF plugin) only supports images with URLs taken from the classpath or as absolute URLs. This doesn=B9t affect normal site generation since that just passes through the URL without resolution and so everything works OK. However, the PDF plugin tries to resolve the path names to images and with = a normal maven site/resources/images layout that that won=B9t work. The reason is that the =8Cbase=B9 for resolving relative file paths URLs is wrong by default. If I use the following pom config: org.apache.maven.doxia doxia-maven-plugin 1.1.3-SNAPSHOT site render-books =20 ${project.build.directory}/site src/site/apt src/site/dev-guide.xml pdf And change the location that =8Citext.basedir=B9 is set to (in 3-4 places...). org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer org.apache.maven.doxia.docrenderer.itext.AbstractITextRender org.apache.maven.doxia.docrenderer.pdf.itext.ITextPdfRenderer org.apache.maven.doxia.module.itext.ITextSink To.. System.setProperty( "itext.basedir", bookFile.getParentFile().getParentFile().getAbsolutePath() ); So that it looks two levels up rather than one level up... Everything seems to work OK. What the changes do are: Generate the PDF to the site directory rather than it=B9s own directory. Create the site before generating PDFs .. note this puts the images in a =8Cknown place=B9 relative to the PDF output. Set up the base for resolution to be consistent for both html and pdf generation. So... having said that, I=B9m wondering what do to do next.. This change isn=B9t entirely backwards compatible (but maybe someone can figure out a way to make it so). I will create a patch for the change but a= m not sure if it is worth doing if it isn=B9t backwards compatible.. The alternative is to keep a private version... I know that a colleague of mine raised a Jira ( http://jira.codehaus.org/browse/DOXIA-356) on this subject. Any thoughts?=20 Steve --B_3343894686_10379860--