Bug report #3466

Extremely Bloated PDF Vector Export under Win.

Added by Thaddeus - over 13 years ago. Updated over 8 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:13526

Description

Under Win using 1.6 I noticed the PC struggling to draw on the screen these PDF printouts to show just one pair of lat/lon point. Examining the the PDF reveals strange huge data XObjects.

The attached example was created by exporting an empty project with no objects on the Composer, that is, launch QGIS, run Composer Manager, Add a composer view and Export it.

The resulting PDF has, out of no where, 3 large embedded images, PDF objects 7, 9 and 11, each with a size of 3508 x 2480 pixels and 3 bytes per pixel in two of them, the other one is grayscale: the total cargo to process and unfold on memory is like 60 mega bytes. Also notice the PDF object 13 with malformed PS code, the third line pushes the graphic setting, and right after that pushes again, followed by pop and pop, push, push, pop, pop and finally push???

QGIS16W_V_Default_Empty.pdf.tar.gz (2.88 KB) Thaddeus -, 2011-02-04 05:15 PM

nada01_1-6_100dpi_vector_win2k.zip (144 KB) Thaddeus -, 2011-02-28 10:26 AM

StreamsFrom___nada01_1-6_100dpi_vector_win2k.zip (207 KB) Thaddeus -, 2011-02-28 10:26 AM

1-6-test.zip (26 KB) Thaddeus -, 2011-02-28 10:27 AM

nada01_1-6_100dpi_vector_win2k.pdf (210 KB) Thaddeus -, 2011-02-28 10:27 AM

qgis1.pdf (109 KB) Giovanni Manghi, 2011-10-07 12:12 PM

print.ps (1.14 MB) Giovanni Manghi, 2011-10-07 12:12 PM

History

#1 Updated by Alister Hood over 13 years ago

I think this is a duplicate of #3217, although I didn't think they were raster objects.

#2 Updated by Thaddeus - over 13 years ago

Here is some test data:

1-6-test.zip
the QGS test file has two layers, an raster image showing a well defined edge --nice for hand tracing-- and a line-SHP layer with the trace of the raster layer: 8 small files in total.

nada01_1-6_100dpi_vector_win2k.pdf
This is the export-to-PDF result under Win2k.

"StreamsFrom+ nada01_1-6_100dpi_vector_win2k.zip"
This is the export-to-PDF result under Win2k with all streams unzipped using PDFtk and then dumping the streams using a script I wrote. 6 streams are readily identified as JPG objects, one has the funny PS code to frame-mask the images behind. 1 image is the off-place SHP trace (purple color) as a raster, which should really be vector, but blanking this object image reveals another raster (object at offset 16765?) copy of the same trace in green color now?. No vector data was found ??

#3 Updated by Thaddeus - over 12 years ago

  • Pull Request or Patch supplied set to No

This was a while ago: I'll recheck on this using the 1.7.7 later. This is using the QGIS' "Export as PDF" functionality and NOT the OS print services. As I remember, the Postscript code of the output is/appears to be corrupted, full of unnecessary operations, like saving/issuing the same PS command a few times in a row, etc. The bloated size is after unzipping the internal streams (say using PDFtk), ie, the way it has to be used/rendered by PDF application: some vector rendering of SHP produces many millions of PS code lines impossible to render on screen.

#4 Updated by Giovanni Manghi over 12 years ago

Yes please, check with qgis 1.7.1 or trunk and report back.

I will attach here the result of exporting your project layout to PDF (using QGIS), using qgis-trunk under Windows Seven. I do not understand about the internal structure of these files, so you may want to have a look into them. The .ps version was made under Linux/QGIS-trunk.

#5 Updated by Thaddeus - over 12 years ago

I tried 1.7.1 under Win2k and got a real nice output with a vector trace out of the SHP and everything in place: my exported PDF file is almost identical to GM's file: only differs on internal time stamp.

cmp --verbose ./myPDF /tmp/otherPDF
214 60 61
216 67 70
217 61 62
218 71 60
219 60 64
220 63 71
222 64 62

It's all great. Without being an expert though, I do believe there is some malformation/redundancy on that PDF PS code.

#6 Updated by Giovanni Manghi over 12 years ago

  • Target version changed from Version 1.7.0 to Version 1.7.4

#7 Updated by Paolo Cavallini about 12 years ago

  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to master
  • Target version changed from Version 1.7.4 to Version 1.8.0

#8 Updated by Paolo Cavallini almost 12 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#9 Updated by Jürgen Fischer about 10 years ago

  • Category changed from 33 to Map Composer/Printing

#10 Updated by Jürgen Fischer about 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#11 Updated by Antonio Locandro almost 10 years ago

I had this issue today, I can't export a map to PDF just consisting of a CSV with about 3000 points (no labels)and an openlayers plugin basemap, size is way over 500 MB before I kill it

#12 Updated by Giovanni Manghi almost 10 years ago

  • Status info deleted (0)

Antonio Locandro wrote:

I had this issue today, I can't export a map to PDF just consisting of a CSV with about 3000 points (no labels)and an openlayers plugin basemap, size is way over 500 MB before I kill it

I have just tested on Windows (qgis 2.2 64bit) using a map from Openlayers and 10000 csv points, using the QGIS pdf printer, at 300 and 600 dpi and paper size up to A0. The pdf was always created very fast and with very reasonable file sizes.

It would be helpful to know what configurations did you used: dpi? paper size? the pdf was created with the native pdf printer? what symbology did you used for the points (svg,other)?

#13 Updated by Giovanni Manghi almost 10 years ago

  • Status changed from Open to Feedback

#14 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Rejected
  • Resolution set to worksforme

closing for lack of feedback.

#15 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Rejected to Closed

Also available in: Atom PDF