7 Replies Latest reply on Sep 7, 2010 12:05 PM by . BrianB

    PDF default output file size is huge

    .Yann Treguier

      Hello, If I print my workbook using the menu command "Print to PDF" it generates a 3MB file.  That is huge by any PDF standards.  If I however, use the menu command "PRINT", select PDF as a printer and then select the "Standard" option, it saves the same workbook as a 200k file.  Now I can clearly see the difference in quality as the second one tends to be a bit fuzzy in spots.

       

      Using the second method ("PRINT" menu then select PDF as a printer), I tried all of the pre-canned PDF setups: Standard, High Quality and Press Quality.  All of those generate small size files but none is remotely close to the quality that Tableau generates when using the "PRINT To PDF" menu. Can you recommend a custome setup of the PDF print defaults that would take me to a high quality without generating a 3MB file (<1MB for sure)?

        • 1. Re: PDF default output file size is huge
          Richard Leeke

          I think the distinction between "Print to PDF" and selecting PDF as a printer is that in the first case it is Tableau that is controlling the content of the PDF, in the second case it is whatever PDF printer driver you happen to have installed on your PC.  I guess the PDF printer option is available whatever application you are printing from, is it?

           

          When you use the "Print to PDF" Tableau option, Tableau is including every mark from your visualisation in the resulting PDF file.  You can often actually see all the marks being drawn on top of each other as a big PDF opens. Some of my visualisations have millions of marks - which can result in huge PDFs (tens or even hundreds of MB).  By contrast, I guess that your PDF printer driver is rendering the PDF so that it only includes the "visible" marks (i.e. whatever is on top and would show at the target resolution).

           

          So increasing the quality you get through your printer driver is down to the capabilities of your particular driver.

           

          The way I use to reduce the size of the PDF generated by "Print to PDF" is to reduce the number of marks in the original visualisation.  How you do that depends a lot on the nature of the visualisation.  I posted a long, detailed, description of how to speed up visualisations (particularly scatter charts) with large numbers of marks here:

           

          http://www.tableausoftware.com/forum/improving-performance-avoiding-drawing-multiple-marks-same-location

           

          This has a side effect of making the PDF smaller.

           

          Note that another way of getting a small but high quality graphic is to export the view as an image (as a *.png file, for example).  Rendering the image in that way it only seems to include the "top-most" visible marks.

           

          One of the Tableau folk (James) picked up on the possibility of optimising the PDF generation along the lines of what happens with image exports in another thread where this was discussed - in fact the thread that prompted the monster posting I linked to above.  So maybe one day the problem will just magically go away.  In the meantime, you have options to take control for yourself.  Here's that other thread I mentioned:

           

          http://www.tableausoftware.com/forum/map-issue-lat/lon

          • 2. Re: PDF default output file size is huge
            .Yann Treguier

            In my case, I really don't think the juxtaposition of marks is the issue.  I have a title, a table and a line charts with two lines that don't often cross each other's path.  My main observation was that the text actually generated by the "PRINT TO PDF" menu was as clear and define as can be.  Where the best my PDF driver could do (set on PRESS QUALITY)was slightly fuzzy. 

             

            So what I am wondering, is if Tableau sends settings to the PDF driver and if yes, what they are.  If I knew all of them, I could go into the driver's PDF dialog box and start playing with them.  As it is, there are too many combinations possible for me to guess it.

            • 3. Re: PDF default output file size is huge
              James Baker

              Interesting.  When you export directly to PDF from Tableau, the PDF content is natively generated by Tableau, and I can talk a bit about that.  When you print to a "fake printer" (postscript-to-PDF conversion program), Tableau doesn't detect anything special about that particular 'printer' and sends no specific commands/settings to tailor anything post-printing.

               

              A couple things might bloat file size in non-scatterplot exports.  The first is font embedding: If the font you're using is any but a few of the most basic fonts, the font you're using is packaged inside the PDF.  Tableau tries to slim it down by including only the characters that are actually used, but you can still get a fair amount of font into a file, especially with East Asian languages.  The second thing that comes to mind is line segments.  The vector graphics representation is fairly verbose, and if your two lines actually contain lots of line segments, then 3MB might not be an unreasonable size.

               

              If a PDF is hundreds of MB, it's definitely a Tableau issue.  At 3MB, though, it could be any number of things.  If I had to guess, I'd go with the font being the main cause - Tableau does no compression of the character glyph files, but if they were compressed in the fake/print path, compression could be the source of the fuzziness.

              • 4. Re: PDF default output file size is huge
                Richard Leeke

                Good point James, very probable.

                 

                It's actually fairly easy to tell which of those it is if you just open the PDF file with a text editor.  Although it's a binary file, there are large chunks of free text, including the coordinates of the graphics and also descriptors of the fonts.  The latter immediately precede the binary objects for the embedded fonts, so you'll see something like this followed by a chunk of binary (the forum may mangle what I'm pasting here slightly):

                 

                18 0 obj

                  << /Type /FontDescriptor

                    /FontName /Arial

                    /FontBBox [ -2000 -2000 4000 4000 ]

                    /Flags 4

                    /FontFile2 19 0 R

                  >>

                endobj

                 

                19 0 obj

                  << /Length 20 0 R

                    /Length1 21 0 R

                    /Filter /FlateDecode

                 

                  >>

                stream

                • 5. Re: PDF default output file size is huge
                  .Yann Treguier

                  I understand what both of you are saying about the font, I am just not quite sure then what settings to adjust in the PDF printer dialog box.  So if you go to Control panel---Printers---PDF---Print Preferences---Edit default settings, what would you change and on what screen to try to remedy the problem you are describing?

                   

                  I tried several things including adding the two fonts I use to the "Always Embed" window.  It still does not produce as clean of a rendition as when done from the "PRINT TO PDF" Tableau option.

                   

                  I opened the PDF file in Notepad and nowhere was any english references to the fonts.

                  • 6. Re: PDF default output file size is huge
                    James Baker

                    I have no idea.  I don't know if your PDF fake printer even has the right settings or can do it right.  It would seem probable, but I don't have the same software that you do.

                    • 7. Re: PDF default output file size is huge
                      . BrianB

                      The reason that the file produced from Tableau Print to PDF option is so much larger has nothing to do with the font. In both cases whether you use Print to PDF or you use the Adobe PDF Printer the file will contain the embedded font file. The reason that the Tableau version is so much larger is simply that nothing is compressed or optimized in the resulting PDF when you use "Print to PDF" from Tableau. Every object in the workbook is written out and drawn separately.

                       

                      I would suggest that when using your Adobe PDF printer option you could try "Press Quality" as the settings. That should retain high quality prints, but give you some object compression and font sub-setting that will help to reduce the file size.

                       

                      Hope that helps