Hi,
Can anyone help with improving the quality of my pdf in flex.
Image which is been added has very low resolution.
This is the code which I have used till now for exporting the pdf.
Thanks in advance
Regards,
myPDF = new PDF(Orientation.LANDSCAPE,Unit.MM, Size.LETTER); myPDF.setDisplayMode(Display.FULL_PAGE, Layout.SINGLE_PAGE); map.scaleBarVisible = true; map.zoomSliderVisible = false; map.panArrowsVisible = false; setPDFPageElements(myPDF, 220, 150, "Attribute Query Output " , "", "Copyright: State Planning Commision"); myPDF.addImage(map,null,20,20,220,150,0,1,false,ImageFormat.JPG,100,Blend.NORMAL,null); var grid:org.alivepdf.data.Grid; var dataArray:Array = ArrayCollection(dgAttribute1.dataProvider).toArray(); grid = new org.alivepdf.data.Grid(dataArray, 0, 0, new RGBColor(0x999999), new RGBColor(0xFFFFFF),false, new RGBColor(0x000000), 1,Joint.MITER, null); grid.columns = createGridColumns(); var newPage:Page = new Page ( Orientation.LANDSCAPE, Unit.MM, Size.LETTER ); myPDF.addPage(newPage); myPDF.getCurrentPage().setUnit(Unit.MM); myPDF.textStyle(new RGBColor(0x000000), 1); myPDF.addGrid(grid, 3.5, 3.5, true); var file : FileReference = new FileReference() file.save(myPDF.save(Method.LOCAL),"exportresult.pdf");
Solved! Go to Solution.
Hey Robert,
In my case it showing degraded quality because of some other reasons.
Thanks!
Akshay,
The maps image quality is normally just 96 DPI as it is only for screen display, so the only way you will achieve better is to use PrintTask and a round trip to the server to request a image at a higher DPI and suffer the lag time for that to occur.
Robert,
Actually the problem is quality degrade below 96 DPI when converted to pdf.
Is there any way so that I can maintain at least 96DPI.
Akshay,
I am using almost the same code and I do not see degraded quality:
var rs:Resize= new Resize("FitToPage","left"); myPDF.addImage(map,rs,0,0,0,0,0,1,false,ImageFormat.JPG,100,Blend.NORMAL,null);
Hey Robert,
In my case it showing degraded quality because of some other reasons.
Thanks!