# HG changeset patch # User Ingo Weinzierl # Date 1274856303 0 # Node ID b303614647755acadb9c265fad0da24a5b5d33bf # Parent 8f836fb6f59226761825f1e92be77142d52ad337 The pdf format depends on the chart's aspect ratio (issue290). gnv-artifacts/trunk@1126 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8f836fb6f592 -r b30361464775 gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Tue May 25 17:46:28 2010 +0000 +++ b/gnv-artifacts/ChangeLog Wed May 26 06:45:03 2010 +0000 @@ -1,3 +1,15 @@ +2010-05-26 Ingo Weinzierl + + Issue290 - PDF format belongs to the chart's aspect ratio. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Removed reading the system property "export.pdf.landscape" to adjust the + page format of a pdf. + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: The page + format of a pdf now depends on the chart's aspect ratio. If width > height + the format will be landscape, otherwise the format will be portrait. + 2010-05-25 Ingo Weinzierl Issue286 diff -r 8f836fb6f592 -r b30361464775 gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java Tue May 25 17:46:28 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java Wed May 26 06:45:03 2010 +0000 @@ -235,7 +235,6 @@ OutputStream out, JFreeChart chart, String pageFormat, - boolean landscape, float marginLeft, float marginRight, float marginTop, @@ -256,6 +255,8 @@ int chartWidth = (Integer) context.getContextValue("chart.width"); int chartHeight = (Integer) context.getContextValue("chart.height"); + boolean landscape = chartWidth > chartHeight ? true : false; + int width = 0; int height = 0; if (landscape) { diff -r 8f836fb6f592 -r b30361464775 gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Tue May 25 17:46:28 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Wed May 26 06:45:03 2010 +0000 @@ -85,15 +85,6 @@ Boolean.parseBoolean(System.getProperty("cache.chart", "false")); /** - * A field parsing a system property to adjust the alignment of pdf exports. - * The system property is 'export.pdf.landscape' and should be true or - * false. If this property is true, PDFs will be created in landscape - * format. - */ - protected static final boolean PDF_FORMAT_LANDSCAPE = - Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true")); - - /** * Supported image export formats. */ protected static final String[] IMG_EXPORT_FORMAT = { @@ -389,7 +380,6 @@ chartLables, uuid, "A4", - true, callContext ); } @@ -445,7 +435,7 @@ outputStream, histograms, "A4", - PDF_FORMAT_LANDSCAPE, + true, 50F, 50F, 50F, 50F ); } @@ -848,7 +838,6 @@ ChartLabels chartLables, String uuid, String exportFormat, - boolean landscape, CallContext context ) { Chart chart = getChart( @@ -874,7 +863,6 @@ outputStream, chart.generateChart(), "A4", - PDF_FORMAT_LANDSCAPE, 50F, 50F, 50F, 50F, context );