From: axelcl Date: Sat, 19 Feb 2005 00:18:47 +0000 (+0000) Subject: improved PDF export support (better Chapter titles) X-Git-Url: http://git.phpeclipse.com?hp=8cfa765dccf30d2b37c9e6d9cc889b8f8cf091a1 improved PDF export support (better Chapter titles) --- diff --git a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar index 8919cd7..8059aea 100644 Binary files a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar and b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar differ diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/pdf/WikiPDFExporter.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/pdf/WikiPDFExporter.java index 0b387dd..e97dd4d 100644 --- a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/pdf/WikiPDFExporter.java +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/export/pdf/WikiPDFExporter.java @@ -218,18 +218,24 @@ public final class WikiPDFExporter implements IRunnableWithProgress { file = (IFile) list.get(i); if (file.exists()) { monitor.subTask(WikiEditorPlugin.getResourceString("Export.exportFile") + file.getLocation()); - System.out.println(file.getLocation().toString()); + StringBuffer htmlBuffer = new StringBuffer(); htmlBuffer.append(""); boolean noContent = CreatePageAction.createFragmentPage(file, htmlBuffer); htmlBuffer.append(""); - System.out.println(htmlBuffer.toString()); if (!noContent) { - // TODO add the real title from corresponding *.xml file here: - Paragraph title = new Paragraph(file.getName(), FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, - new Color(0, 0, 255))); + System.out.println(file.getLocation().toString()); + System.out.println(htmlBuffer.toString()); + String fileName = file.getName(); + fileName = fileName.replaceAll("_", " "); + int dotIndex = fileName.lastIndexOf('.'); + if (dotIndex>0) { + fileName = fileName.substring(0,dotIndex); + } + Paragraph title = new Paragraph(fileName, FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, + Color.BLACK)); Chapter chapter = new Chapter(title, chapterNumber++); document.add(chapter); appendArticle(document, htmlBuffer);