Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely Bloated PDF Vector Export under Win. #13526

Closed
qgib opened this issue Feb 4, 2011 · 15 comments
Closed

Extremely Bloated PDF Vector Export under Win. #13526

qgib opened this issue Feb 4, 2011 · 15 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@qgib
Copy link
Contributor

qgib commented Feb 4, 2011

Author Name: Thaddeus - (Thaddeus -)
Original Redmine Issue: 3466
Affected QGIS version: master
Redmine category:map_composer/printing
Assignee: Marco Hugentobler


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???


@qgib
Copy link
Contributor Author

qgib commented Feb 9, 2011

Author Name: Alister Hood (@AlisterH)


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

@qgib
Copy link
Contributor Author

qgib commented Feb 28, 2011

Author Name: Thaddeus - (Thaddeus -)


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 ??

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Thaddeus - (Thaddeus -)


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.


  • pull_request_patch_supplied was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Oct 7, 2011

Author Name: Giovanni Manghi (@gioman)


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.


  • 3470 was configured as qgis1.pdf
  • 3471 was configured as print.ps

@qgib
Copy link
Contributor Author

qgib commented Nov 8, 2011

Author Name: Thaddeus - (Thaddeus -)


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.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was changed from Version 1.7.0 to Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • crashes_corrupts_data was configured as 0
  • version was configured as master
  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Apr 6, 2014

Author Name: Jürgen Fischer (@jef-n)


  • category_id was changed from 33 to Map Composer/Printing

@qgib
Copy link
Contributor Author

qgib commented Jun 28, 2014

Author Name: Jürgen Fischer (@jef-n)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - Lower Priority

@qgib
Copy link
Contributor Author

qgib commented Jul 3, 2014

Author Name: Antonio Locandro (Antonio Locandro)


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

@qgib
Copy link
Contributor Author

qgib commented Jul 3, 2014

Author Name: Giovanni Manghi (@gioman)


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)?


  • status_info was changed from 0 to

@qgib
Copy link
Contributor Author

qgib commented Jul 3, 2014

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Giovanni Manghi (@gioman)


closing for lack of feedback.


  • status_id was changed from Feedback to Rejected
  • resolution was changed from to worksforme

@qgib
Copy link
Contributor Author

qgib commented Dec 20, 2015

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Rejected to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels May 24, 2019
@qgib qgib added this to the Future Release - Lower Priority milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

1 participant