I am printing some custom drawn charts on a fast Reports 4 databand.
The band has one text component and one picture component which I manipulate in the OnBeforePrint event to draw my charts using its canvas.
The problem is that the width of the charts may change drastically and go far beyond the page width and scaling/streching the charts to fit the page limits is not an option for the user.
I tried to make the page width grow to accommodate the graphics and it worked very well while visualizing, but I cannot print it since the user's printer only accepts A4 paper size.
So how can I split the report in smaller A4 pieces like the following image?
PS: the first image is the actual report output and the second one is the desired result.
Related
fist off, if there is an exchange place more suitable for the question, please address me.
I'm designing some labels in gimp.
I created a A4 300dpi document and created the artwork, arranged them to use all the page. To measure the labels I create a rectangle with the "rectangle selection tool" and there one can inspect the size in cm:
I printed straight from gimp and to my surprise, the printed labels where smaller than designed. I assumed somehow someone along the line added margins to my already A4 document..
I tried saving to PDF and then printing the PDF, very similar results.
I'd say the difference is around 5%
What would be the appropriated method for printing exactly at the size I created the document ignoring any margins ??
I'm using Windows 10, HP ENVY 5010 and Gimp 2.10
I have a dynamic PDF report which gives monthly report of our database. I am using Prawn to generate the PDF report.
The monthly report can contain maximum of 90 rows (maximum 3 per day). There can also be days with no record. So, the number of rows in a monthly report is highly dynamic.
The client needs the report in a single page PDF. They dont care if the font size becomes very small or the row height is really small. But the contents should fit in a single page.
They have shown examples of PDF that are generated using their previous application. In those, it seems that they are creating the table with a fixed font size and row height etc. and they are somehow zooming out so that the PDF has some whitespace in the right side of the page, but it fits in a single page.
Something like this:
Is there a way to achieve this in Prawn?
The needed page layout can be easily achieved with PD4ML's fitPageVertically() API call - but PD4ML approach differs from Prawn quite significantly.
With PD4ML you have to generate an HTML document with report data/table (not that tricky to do) and after that pass it to PD4ML for a converting to PDF.
PD4ML in Ruby scenario can be launched as a standalone converter application.
You can build a fixed size table for print with option:
overflow: :shrink_to_fit
in table cells. That will shrink to a smaller font automatically.
given the number of rows to be print, you can dynamically adjust tables row heights
see: http://prawnpdf.org/prawn-table-manual.pdf
I'm trying to use the print() function on a Highstock chart, but its not printing well when my chart is very large (almost full screen, for example 1800x1000 pixels),
The problem is that it prints over multiple pages, and also most part of the right half of the chart gets cut off...
Is there a way to resize the chart before printing (but not resize on screen), or is there some sort of "scale to fit page" functionality?
Basically I just want it to look nice on a4 / letter paper format.
Take a look at the exporting parameters here. You can specify scale and sourceWidth and sourceHeight. As for "look nice" you will have to play around with the sizes until you reach this subjective goal.
Description of Application:
I have an application that allows a user to output a report to a document. The data that is written to the document is in the form of a table. The number of columns in the table and the width of the strings contained in each cell in the table are unknown until runtime (it depends on what query the user runs, what they want to see in the report etc.).
I'm using Delphi XE and Gnostice's eDocEngine to create a PDF document, and then creating a table in the document and writing the report data into it.
Problem:
The problem that I'm having is that you can only write a certain number of columns (6 or 7) into the document before they disappear off the right hand side of the document. It isn't unknown for a user to produce a report with 30 or 40 columns in the table (as they correspond to fields in a database, which they run a query over), so I need to be able to get the table to fit entirely into the document, no matter how many columns it contains.
As a PDF can be zoomed, I suppose I could shrink the font size and column widths down and fit everything in that way, as the user could then zoom in and scroll around the table using their PDF reader. What I need to know is:
Is there a better way of getting the entire table to fit onto a page?
If shrinking/zooming is the best/only way of doing this, what is the most efficient way of ensuring that everything fits without making the document look strange (i.e. the table should ideally stretch across the page, rather than be bunched up to the left hand side because of some random scaling algorithm).
Edit
I've just done some more digging around and I've found "inputXRes" and "inputYRes" properties that change the scale of the canvas in the document, which looks promising, but I can't get it to work properly at the moment. Can anyone shed any light on how those properties are used? The text itself is scaling, but the size of the table stays the same, meaning that I've now got a tiny piece of text in the middle of a huge table cell, and the table is still only displaying 7 columns in the report.
Don't mess with scaling and font size.
Your customers will use PDF Reader and there are some options that will help to read the informations e.g. 1:1. But when you change the scaling or font size you cannot read the information, because it is too small.
Get a font size that fits perfect the needs of your customers and extend the page size to fit the table size.
With PDF Reader your customers will have the choice to view and print (shrink to fit) as they like and which paper size their print can handle.
BTW:
If you change the resolution and draw a line with a length of 2 inch on the canvas it will be 2 inch long, but a text with font size 12 (pixels) will grow or shrink.
I am trying to generate PDF documents server side containing data tables and charts generated by HighCharts. I am using highchart-serverside-export and iText.
I have been able to generate the documents but the chart images are grainy when printed. From what I understand, iText uses 72dpi by default when inserting an image. The correct way to get higher fidelity images is to start with a larger image and scale it down using one of the scaling functions such as scalePercent().
I can easily generate a larger chart image by passing in larger height and width parameters to Highcharts. The problem is that when you increase the dimensions of the chart, the content does not scale up (eg. font size of lables). In fact, you get more detail in some places (eg. more axis ticks). The reason this is a problem is that when you then apply the scaling down via iText, these items become very small and hard to read.
I have looked at the Highcharts API and cannot see a way to get Highcharts to scale up the contents rather than add more detail. How do I get this to work?
If the approach I am using is completely wrong, the wider question is how do I get print resolution server-side Highcharts charts? I have to use iText but am willing to try an alternative technology to do the chart rendering.
try this
exporting: {
sourceWidth: 1000,
sourceHeight: 400,
},
Link to JsFiddle
You can specify the width of the exported image using the exporting.width property.
This will not increase the size of the div or add/remove details or anything of that sort, it will simply scale the generated svg according to the specified width, maintaining the aspect ratio. Hence also scaling everything including texts etc.
exporting: {
width:2000 // or scale down to 100
}
Upscaling exported images / pdf | Highcharts & Highstock # jsFiddle