objective c - Drawing pdf in Cocoa with antialias -


i developing application requires converting pdf image. problem facing in pdfs there white lines.

this code use converting pdf image.

nspdfimagerep* pdfrep = [nspdfimagerep imagerepwithcontentsoffile:path]; [pdfrep setcurrentpage:page];  nsbitmapimagerep* bmrep;  nsrect pdfbounds=[pdfrep bounds];  nsrect target=[nsbitmapimagerep scalingsizefittingin:pdfbounds.size targetsize:size];  bmrep = [[nsbitmapimagerep alloc] initwithbitmapdataplanes:null                                                 pixelswide:size.width                                                 pixelshigh:size.height                                              bitspersample:8                                            samplesperpixel:4                                                   hasalpha:yes                                                   isplanar:no                                             colorspacename:nscalibratedrgbcolorspace                                                bytesperrow:0                                               bitsperpixel:0];  nsgraphicscontext* context = [nsgraphicscontext                               graphicscontextwithbitmapimagerep:bmrep];  [nsgraphicscontext savegraphicsstate]; [nsgraphicscontext setcurrentcontext:context]; [[nsgraphicscontext currentcontext] setshouldantialias:no]; [[nsgraphicscontext currentcontext] setimageinterpolation:nsimageinterpolationhigh]; [[nsgraphicscontext currentcontext] setcolorrenderingintent:nscolorrenderingintentperceptual];  // draw pdf rep bitmap rep. [pdfrep drawinrect:target];  [nsgraphicscontext restoregraphicsstate]; 

if set shouldantialias no image image antialise set no

and image shouldantialias set yes image antialise set yes

the question how can rid of white stripes , keep image smooth? thanks.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -