How to improve the pdf quality in flex

4327
4
Jump to solution
05-12-2015 11:53 PM
akshayloya
Occasional Contributor II

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");
0 Kudos
1 Solution

Accepted Solutions
akshayloya
Occasional Contributor II

Hey Robert,

In my case it showing degraded quality because of some other reasons.

Thanks!

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

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.

akshayloya
Occasional Contributor II

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.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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);
0 Kudos
akshayloya
Occasional Contributor II

Hey Robert,

In my case it showing degraded quality because of some other reasons.

Thanks!

0 Kudos