Search Results

Search found 14 results on 1 pages for 'rasterize'.

Page 1/1 | 1 

  • How to distill / rasterize a PDF in Linux

    - by Sampo
    We have a printer at our office that prints PDF files from a USB stick. It prints most files okay, but it has problems with some, especially ones generated with Latex. Some PDFs it simply refuses to print, some PDFs it prints with courier-type font, and some it prints fine except for equations. I'm looking for a way to "distill" PDFs into a dead-sure format to print. Either by simplifying / normalizing the PDF to the point that any renderer will render it correctly, or by simply making each page a 600dpi raster image in the PDF. (I could split the PDF into individual raster images and combine them manually, but I want something scriptable.) The output file size doesn't matter, as long as it's sure to print, has A4 paper size (or the original) and 300~600dpi resolution.

    Read the article

  • Phantomjs creating black output from SVG using page.render

    - by Neil Young
    I have been running PhantomJS 1.9.6 happily on a turnkey Linux server for about 4 months now. Its purpose is to take an SVG file and create different sizes using the page.render function. This has been doing this but since a few days ago has started to generate a black mono output. Please see below: The code: var page = require('webpage').create(), system = require('system'), address, output, ext, width, height; if ( system.args.length !== 4 ) { console.log("{ \"result\": false, \"message\": \"phantomjs.rasterize: error need address, output, extension arguments\" }"); //console.log('phantomjs.rasterize: error need address, output, extension arguments'); phantom.exit(1); } else if( system.args[3] !== "jpg" && system.args[3] !== "png"){ console.log("{ \"result\": false, \"message\": \"phantomjs.rasterize: error \"jpg\" or \"png\" only please\" }"); //console.log('phantomjs.rasterize: error "jpg" or "png" only please'); phantom.exit(1); } else { address = system.args[1]; output = system.args[2]; ext = system.args[3]; width = 1044; height = 738; page.viewportSize = { width: width, height: height }; //postcard size page.open(address, function (status) { if (status !== 'success') { console.log("{ \"result\": false, \"message\": \"phantomjs.rasterize: error loading address ["+address+"]\" }"); //console.log('phantomjs.rasterize: error loading address ['+address+'] '); phantom.exit(); } else { window.setTimeout(function () { //--> redner full size postcard page.render( output + "." + ext ); //--> redner smaller postcard page.zoomFactor = 0.5; page.clipRect = {top:0, left:0, width:width*0.5, height:height*0.5}; page.render( output + ".50." + ext); //--> redner postcard thumb page.zoomFactor = 0.25; page.clipRect = {top:0, left:0, width:width*0.25, height:height*0.25}; page.render( output + ".25." + ext); //--> exit console.log("{ \"result\": true, \"message\": \"phantomjs.rasterize: success ["+address+"]>>["+output+"."+ext+"]\" }"); //console.log('phantomjs.rasterize: success ['+address+']>>['+output+'.'+ext+']'); phantom.exit(); }, 100); } }); } Does anyone know what can be causing this? There have been no server configuration changes that I know of. Many thanks for your help.

    Read the article

  • Can iTextSharp rasterize/export to JPEG or other image format?

    - by SkippyFire
    I need to be able to export PDF's that I am creating to JPEG, so that users can have a screenshot/thumbnail of the end product, which is faster than opening the whole PDF. I am running this on an ASP.NET website running in Medium Trust in the Rackspace Mosso Cloud. I have yet to find a library that will either work in Medium trust, or in the case of ABC PDF, which works great locally, wont load in Mosso. Maybe Mosso has a custom trust level? I know that iTextSharp works on Mosso, but I haven't been able to figure how to "screenshot" a single page of a PDF, or export a page to JPEG. Is there anyone out there who has done this before?

    Read the article

  • PhantomJS not exactly rendering HTML to PNG

    - by John Leonard
    I'm having trouble adjusting PhantomJS to create a PNG file that matches the original browser presentation. Here is the entire sample html file. It's a sankey diagram creating using rCharts and d3-sankey. (You'll need to save the file to your hard drive and view it from there.) I'm running on Windows and using rasterize.js: >> phantomjs.exe rasterize.js test.html test.png ISSUE: Below is a snip of one of the text strings when viewed in a browser: And here is a snip of the same string from the PNG created by PhantomJS: How do I make the text-shadow go away? I've played around with various CSS attributes (text-shadow) and webkit-specific attributes (e.g., -webkit-text-rendering), but can't seem to make it go away. Is this a setting in PhantomJS? in the underlying webkit? or somewhere else? Many thanks!

    Read the article

  • Saving "heavy" figure to PDF in MATLAB - rendering problem

    - by yuk
    I generate a figure in MATLAB with lot amount of points (100000+) and want to save it into a PDF file. With zbuffer or painters renderer I've got very large and slowly opened file (over 4 Mb) - all points are in vector format. Using OpenGL renderer rasterize the figure in PDF, ok for the plot, but not good for text labels. The file size is about 150 Kb. Try this simplified code, for example: x=linspace(1,10,100000); y=sin(x)+randn(size(x)); plot(x,y,'.') set(gcf,'Renderer','zbuffer') print -dpdf -r300 testpdf_zb set(gcf,'Renderer','painters') print -dpdf -r300 testpdf_pa set(gcf,'Renderer','opengl') print -dpdf -r300 testpdf_op The actual figure is much more complex with several axes and different types of plots. Is there a way to rasterize the figure, but keep text labels as vectors? Another problem with OpenGL is that is does not work in terminal mode (-nosplash -nodesktop) under Mac OSX. Looks like OpenGL is not supported. I have to use terminal mode for automation. The MATLAB version I run is 2007b. Mac OSX server 10.4.

    Read the article

  • Saving "heavy" image to PDF in MATLAB - rendering problem

    - by yuk
    I generate a figure in MATLAB with lot amount of points (100000+) and want to save it into a PDF file. With zbuffer or painters renderer I've got very large and slowly opened file (over 4 Mb) - all points are in vector format. Using OpenGL renderer rasterize the figure in PDF, ok for the plot, but not good for text labels. The file size is about 150 Kb. Try this simplified code, for example: x=linspace(1,10,100000); y=sin(x)+randn(size(x)); plot(x,y,'.') set(gcf,'Renderer','zbuffer') print -dpdf -r300 testpdf_zb set(gcf,'Renderer','painters') print -dpdf -r300 testpdf_pa set(gcf,'Renderer','opengl') print -dpdf -r300 testpdf_op The actual figure is much more complex with several axes and different types of plots. Is there a way to rasterize the figure, but keep text labels as vectors? Another problem with OpenGL is that is does not work in terminal mode (-nosplash -nodesktop) under Mac OSX. Looks like OpenGL is not supported. I have to use terminal mode for automation. The MATLAB version I run is 2007b. Mac OSX server 10.4.

    Read the article

  • How can I export PDF from InDesign so that transparency renders properly on all platforms?

    - by strangeronyourtrain
    Gradients, including drop shadows, all show up as solid blocks when I view my document on an Android phone. I tried different PDF compression and compatibility settings in an attempt to flatten and rasterize all the graphics, but it's clearly not working, as the Android viewer still identifies the outlines of transparent shapes instead of the blended pixels. Is there any way to truly flatten these PDF graphics, so that it doesn't matter whether a PDF viewer supports transparency, while keeping the text as text?

    Read the article

  • How Did we get from CLI to Graphics?

    - by Nathaniel Bennett
    I'm confused when looking into graphics - specifically with operating systems. I mean, how can a computer render a CLI/console along with a GUI. GUI's are completely different from Text. and How Can we have GUI windows that Display Text interfaces, ie how can we have CLI in modern Graphics Operating system - that's what I'm mainly trying to grip on to. How Do Graphic's get rendered to display? is there some sort of memory address that a GPU access which holds all pixel data, and there system's within OS's that Gather the pixel position of Windows and Widgets, along with the Z Index and rasterize them to that memory address, which then the GPU loads to the screen? How About the CLI's integrated with Graphics? how does the OS Tell the GPU that a certain part of the screen wants to display text while the rest, whats to display pixel data? it's all very confusing. Shed some light in it, will ya?

    Read the article

  • How can a computer render a CLI/console along with a GUI?

    - by Nathaniel Bennett
    I'm confused when looking into graphics - specifically with operating systems. I mean, how can a computer render a CLI/console along with a GUI? GUI's are completely different from text. And how can we have GUI windows that display text interfaces, ie how can we have CLI in modern Graphics Operating system - that's what I'm mainly trying to grip on to. How does graphics get rendered to display? Is there some sort of memory address that a GPU access which holds all pixel data, and there system's within OS's that gather the pixel position of windows and widgets, along with the Z Index and rasterize them to that memory address, which then the GPU loads to the screen? How about the CLI's integrated with Graphics? How does the OS tell the GPU that a certain part of the screen wants to display text while the rest wants to display pixel data?

    Read the article

  • Flattening PDF transparency

    - by Jan
    I have a PDF, made with Inkscape, that uses transparent colors. This image shall be used in a LaTeX document. While preserving the transparency is nice for editing, it can be a problem for printing. Printing usually involves PDF to PS conversion. Since Postscript does not support transparency, this requires either flatting, i.e. creating a vector graphic that works without transparency or rastering, i.e. rendering a bitmap image. When a PDF document containing such a figure is printed (or converted to PS) using Evince (or Cairo or Ghostscript), the whole page gets rendered as a bitmap, rendering fonts ugly (different from other pages). (Adobe Acrobat handles such PDFs well.) Unfortunately, converting the PDF figures to EPS (before including them with LaTeX) doesn't help much, because both pdftops and pdf2ps (again, Cairo or Ghostscript) rasterize the image, i.e. render a bitmap (saved as EPS). (This is slightly better, because it doesn't affect the whole page, but I'd still prefer a vector graphics.) How can I flatten transparency with Inkscape or other software on Linux?

    Read the article

  • Bad results converting PDF to EPS on Linux

    - by Tim
    I'm having some trouble converting PDFs (created by Adobe Illustrator on a Mac) to EPS. I have tried several things but I am wondering if there is a better option. The following list is ordered by decreasing quality: inkscape --export-area-page --export-eps=out.eps in.pdf using the graphical program Inkscape works best, but is a bit slow; pdftops -eps in.pdf out.eps uses Poppler and works good and is fast; pdf2ps in.pdf out.eps uses ghostscript and works ok for simple documents; convert in.pdf out.eps uses ImageMagick and always rasterizes the image. I haven't tested the following: acroread -toPostScript use acroread (Linux only) Some issues I've found: Transparency is not supported in EPS, but instead of flattening the layers, most programs rasterize the image producing big files and ugly graphs. Inkscape does this best by only rasterizing the unsupported area. Gradients are rendered properly by Inkscape, but Poppler somehow chops up the gradient into many shapes of different colors. Greek symbols are seemingly not supported by Ghostscript and are rasterized (using pdf2ps). What are your experiences for this kind of task? Did I forgot certain programs and/or command line options that improve quality? I found some posts on this, but not a (thorough) comparison of possibilities, please correct me if I'm wrong. Related posts How to convert PDF to EPS? on TeX

    Read the article

  • Overlay SVG diagrams on google maps

    - by ThibThib
    Hello I would like to add an overlay image on a google map. This image is a SVG file I have generated (python with svgfig). I am using the following code if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(48.8, 2.4), 12);     // ground overlay     var boundaries = new GLatLngBounds(new GLatLng(48.283188032632829, 1.9675270369830129), new GLatLng(49.187215000000002, 2.7771877478303999));     var oldmap = new GGroundOverlay("test.svg", boundaries); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.addOverlay(oldmap); } Surprisingly, it works with Safari 4, but it doesn't with Firefox (with Safari 3, the background is not transparent) Does anyone has an idea on how I could overlay a SVG ? Thanks PS1: I read some works like this or the source code of swa.ethz.ch/googlemaps, but it seems that they have to use javascript code to parse the SVG and add one by one all the elements (but I did not understood all the source...) PS2: The SVG is composed of different filled paths and circles, with transparency. If there is no solution to overlay my SVG, I can use 2 alternative solutions: rasterize the SVG convert the paths and circles in GPolygons But, I do not really like the 1st solution because of the poor quality of the bitmap and the time to generate it with antialiasing. And for the 2nd solutions, the arcs, ellipses and circles will have to be decomposed into small polylines. A lot of them will be necessary for a good result. But I have around 3000 arcs and circles to draw, so...

    Read the article

  • Convert a PDF to a Transparent PNG with GhostScript

    - by Jonathon Wolfe
    Hi all. I am attempting, unsuccessfully, to use Ghostscript to rasterize PDF files with a transparent background to PNG files with a transparent background. I've searched high and low for questions from others attempting the same thing and none of the posted solutions, which as far as I can tell come down to specifying -sDEVICE=pngalpha, have worked with my test files. At this point I would really appreciate any advice or tips a more experienced hand could provide. My test PDF is located here: http://www.kolossus.com/files/test.pdf It could be that the issue is with this file, but I doubt it. As far as I can tell, it has no specified background, and when I open the file with a transparency-aware app like Photoshop or Illustrator, sure enough it displays with a transparent background. However, when opened with an application like Adobe Reader the file is rendered with a white background. I believe that this has more to do with the application rendering the PDF than with the PDF itself -- apps like Adobe Reader assume you want to see what a printed document will look like and therefore always show a white canvas behind the artwork -- but I can't be sure. The gs command I'm using is: gs -dNOPAUSE -dBATCH -sDEVICE=pngalpha -r72 -sOutputFile=test.png test.pdf This produces a PNG that has transparent pixels outside of the bounding box of the artwork in the file, but all pixels that are inside the artwork's bounding box are rasterized against a white background. This is a problem for me, as my artwork has drop shadows and antialiased edges that need to be preserved in the final output, and can't just be postprocessed out with ImageMagick. A sample of my PNG output is at the same location as the pdf above, with .png at the end (stackoverflow won't let me include more than one url in my post). Interestingly, I see no effects from using the -dBackgroundColor flag, even if I set it to something non-white like -dBackgroundColor=16#ff0000. Perhaps my understanding of the syntax of this flag is wrong. Also interestingly, I see no effects from using the -dTextAlphaBits=4 -dGraphicsAlphaBits=4 flags to try to enable subpixel antialiasing. I would also appreciate any advice on how to enable subpixel antialiasing, especially on text. Finally, I'm using GPL Ghostscript 8.64 on Mac OS 10.5.7, and the rendering workflow I'm trying to get set up is to generate transparent PNG images from PDFs output by PrinceXML. I'm calling Ghostscript directly for the rasterization instead of using ImageMagick because ImageMagick delegates to Ghostscript for PDF rasterization and I should be able to control the rasterization better by calling GS directly. Thanks for your help. -Jon Wolfe

    Read the article

1