-
1. Re: Print a page with text, image and datagrid
eprevot123 Jun 24, 2011 7:12 AM (in response to eprevot123)still interested if you have an advice
-
2. Re: Print a page with text, image and datagrid
Flex harUI Jun 24, 2011 10:01 AM (in response to eprevot123)Why not use FlexPrintJob and PrintDataGrid?
-
3. Re: Print a page with text, image and datagrid
eprevot123 Jun 28, 2011 6:59 AM (in response to Flex harUI)I didn't know FlexPrintJob, with PrintDataGrid that is what I needed.
Not easy to make it work because I had to wait for BitmapImage to be ready to add the view to the printJob, and also handle layout problems so the PrintDataGrid actually print multiple pages...
But it works now, thanks.
Maybe you can help me on this : when the page is printed, the PrintDataGrid appears to be too big, each row could be twice as small. Is it a resolution problem, is there an option to avoid this ? (same problem with the example at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/printing/PrintDataGr id.html#includeExamplesSummary )
I tried to change the page height to bigger value than printJob.pageheight but then each page of the PrintDataGrid is printed on several pages.
-
4. Re: Print a page with text, image and datagrid
Flex harUI Jun 28, 2011 10:18 AM (in response to eprevot123)Try the rowHeight property on the PrintDataGrid
-
5. Re: Print a page with text, image and datagrid
eprevot123 Jun 29, 2011 9:36 AM (in response to Flex harUI)No, all elements in the page are big, it is not a rowHeight problem, the text is big too (like if it was a 14 or 16 font size). If I reduce the rowHeight I don't see the text in cells.
As if the resolution was too small.
-
6. Re: Print a page with text, image and datagrid
Flex harUI Jun 29, 2011 12:50 PM (in response to eprevot123)There are scaling options on FlexPrintJob.
-
7. Re: Print a page with text, image and datagrid
eprevot123 Jun 30, 2011 1:55 AM (in response to Flex harUI)I noticed this line in the doc :
Note: A point is a print unit of measurement that is 1/72 of an inch. Flex automatically maps 72 pixels to one inch (72 points) of printed output, based on the printer settings.
I don't really understand but I suppose that means FlexPrintJob.pageHeight and FlexPrintJob.pageWidth will always return values according to 72dpi.
I managed to have a 96dpi that reduce the components in my page :
myPage.width = 756;
myPage.height = 1085;
Then if I don't set scale option, it prints the page and a blank page follows. To make it work ok, I have to do :
flexPrintJob.addObject(myPage, FlexPrintJobScaleType.SHOW_ALL);



