2001 JI Open Discussion Posted August 15, 2006 Share Posted August 15, 2006 By: Bart Cassady - bartong PDF Legal (8.5x14) Printing 2002-06-26 12:51Do you have a way to pass page size to the PDF output of the report? iText has the ability to specify page size. Example: Document document = new Document(PageSize.LEGAL); Do you provide a mechanism to access this? If not, could I suggest a "pdfPageSize" attribute for the By: Bart Cassady - bartong RE: PDF Legal (8.5x14) Printing 2002-06-26 12:54Sorry, the browser freaked out and submitted the message before I was done. Do you have a way to pass the page size to the PDF output of the report? iText has the ability to specify page size. Example: Document document = new Document(PageSize.LEGAL); Do you provide a mechanism to access this? If not, could I suggest a "pdfPageSize" attribute for the jasperReports tag? Thanks. Bart By: Teodor Danciu - teodord RE: PDF Legal (8.5x14) Printing 2002-06-27 00:23 Hi, For the moment, this is not possible. That's because the JasperReports object that we use to generate report is a "read-only" entity. We could add to it setter methods like setPageHeight() and setPageWith(), that do not affect the internal structure of the compiled report design and do not need report design recompilation. But my question is: Why do you need to specify the page size at runtime? The report element won't be rearranged automatically to fit the new page size. They will be either chopped, either you will have extra white space on the right. There are still other problems with that: When compiling a report design, we make sure that all sections (especially their height) fit the page size, so that when filling the report we don't encounter situations when we have to print section bigger than the page itself. This is how the engine behaves. A runtime provided page size would pose many problems and I don't think this is the way to do it. Why don't you make a different report design for every page size that you need and switch between them at runtime as needed? I don't think you have to deal with hundreds of different page sizes (maybe 2 or 3). In principle, the report designs are static, only the data required to fill them is dynamic. Thank you, Teodor By: Bart Cassady - bartong PDF Legal (8.5x14) Printing - clarification 2002-07-03 07:39Sorry, I guess I didn't explain myself very well. I need the resulting PDF to know that it is size "LEGAL" so that when the user prints they do not have to select this option. I think that a "pdfPageSize" option on the jasperReport tag would be a reasonable solution, much like the "pdfFontName" option on the font tag. This option could take values used by iText, for example PageSize.LEGAL. Thanks, Bart By: Teodor Danciu - teodord RE: PDF Legal (8.5x14) Printing - clarification 2002-07-17 07:54 Hi, I have made some simple tests and apparently, even if you use a predefined page size when creating the PDF file, that won't make Acrobat Reader recognize it when you open the print dialog. In fact, what happens is that Acrobat uses the default page size of your printer and does not read it from opened PDF file. We might get some answers from the iText discussion forums. Thank you, Teodor By: Bart Cassady - bartong RE: PDF Legal (8.5x14) Printing - works? 2002-07-18 09:52And now that I try it again, it seems to be working properly.... I think that maybe I was mucking up my page heights and widths or something. Sorry to waste your time. By: Ashiq Al Jhan - aljhan RE: PDF Legal (8.5x14) Printing 2002-08-08 07:33I think an additional attribute in the jasperReport element to define the media size would be helpful, especially with the java 1.4 (JPS) where we could specify the MediaSize. in Java 1.4 in the printJob we could specify MediaSizeName.ISO_A4, so that it automatically selects the the A4 size in the Paper selection..This will be helpful because some clients may have the printer's default paper size as 'Letter' and page footers may disappear when he prints a jasper report whose height and width is specified on A4 size. (This will reduce the calls from the users to the support staff complaining 'I don't see the last couple of lines') . This can be included in the DTD now, but the implementation can be done later. By: Bernd Proissl - berndproissl RE: PDF Legal (8.5x14) Printing 2002-08-08 12:53Do you have experience with MediaSize.findMedia()? It should look up a MediaSizeName based on the page dimension. The page dimension is allready in the report definition and may be used to look up the MediaSizeName. Bernd Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now