Bug report #3466
Extremely Bloated PDF Vector Export under Win.
|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|
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???
#2 Updated by Thaddeus - over 9 years ago
Here is some test data:
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.
This is the export-to-PDF result under Win2k.
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 - almost 9 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 almost 9 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 8 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.
#12 Updated by Giovanni Manghi about 6 years ago
- Status info deleted (
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)?