Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Decreasing graph resolution

    I am using Stata to generate reports that are in Rich Text Format with embedded links to encapsulated meta file (EMF) images. Most of the images are Stata graph files (the others are images that are common to all reports). I then use Adobe to convert the reports (n = 1500) into PDF files, the end product. Everything works fine, but the computing overhead is high: it takes more than 12 hours for Stata to write the reports and 24 hours for Adobe to convert them to PDF format. The bottleneck seems to be graph files - when I originally wrote the program, there were only a few graphs per report, and everything ran in a few hours, now there are dozens of graphs for each report. And the number will keep growing, until it takes a week to run a monthly report.

    So - since I'm packing many graphs per page, I'm thinking I could reduce the resolution without loss of quality, but with gains in processing speed. However, I can't find any documentation on changing graph resolution, except through resetting the size via -xsize()- and/or -ysize(). I don't want to change the size of my graphs, that would wreak havoc on the layout. Is there another way to reduce the resolution? I know that eg TIF files can have lower resolution, but Adobe doesn't insert TIF files on the fly when parsing RTF. And yes, if I had time to for a do over I would use TeX, but I don't.

    Thanks for any tips,

    Jeph

  • #2
    Jeph, the EMF file is a vector graphics format. It doesn't have a resolution. Technically it does, and it is about 16000x16000 (if I recall it correctly) but this is more like precision to determine whether two points are same or not. You can reduce the time necessary to render emf by reducing the amount of data in shows. (in raster format, if you put 10000 points in a single pixel, that would be recorded as the one (last) point, in vector format - as 10000 points).

    For raster formats (like PNG) you can use the width option to control resolution. If your graph is 1200px wide and xsize=4 inches, then your resolution should be 300dpi.

    As for the 1500 reports, hm, see this.

    Best, Sergiy

    Comment


    • #3
      Sergiy, thanks for the reply. I can't reduce the amount of information in the graphs, I don't think, so it sounds like I need a raster format. PNG and BMP are the only raster formats, correct? I will see if I can persuade Adobe to read an RTF to link to a BMP.

      thanks,
      Jeph

      Comment


      • #4
        I mean TIFF of course not BMP.

        Comment


        • #5
          TIFF is also a raster format.

          it takes more than 12 hours for Stata to write the reports and 24 hours for Adobe to convert them to PDF format
          So Stata is twice faster than Adobe!

          Perhaps you can have more luck if you export from Stata to pdf right away? Usually this is possible if all your graphs are on separate pages. Though at a cost of page headers, footers, page numbers etc. Without seeing a document, hard to say. I just hope those are not mass patent applications .

          Best, Sergiy Radyakin

          Comment


          • #6
            Stata is writing out a lot of RTF text, adding links to various image files, including graphs that it creates at the same time. These are user-friendly reports (they go to CEOs at 1500 hospitals) with a mandated layout; I can't really create anything similar directly in Stata.

            Comment

            Working...
            X