Bug 45168 - Add Option to crop (reduce size of) Images in PDF Export
Summary: Add Option to crop (reduce size of) Images in PDF Export
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: EasyHack DifficultyInteresting SkillCpp
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 04:57 UTC by Fernand
Modified: 2014-10-14 11:46 UTC (History)
7 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Fernand 2012-01-24 04:57:59 UTC
The size of PDF files produced by LO-PDF export can be the double of this produced using postscript rendering.
By postscript rendering images use only the CROPED size off the images,  the LO-
Cairo-rendering uses the FULL image to store in the PDF file.
I do not know if Cairo lets the choice between Cropped and Full size
rendering ?
For editing PDF , full size is handy, but a option with the choise between the two would be super handy.
Reducing Size for PDF (on the web) is still important !
Comment 1 Thorsten Behrens 2012-02-22 01:16:27 UTC
That's a nice localized change that would be suitable as an EasyHack: one would need to review all methods rendering bitmaps in vcl/source/gdi/pdfwriter_impl.cxx (e.g. PDFWriterImpl::drawJPGBitmap() etc), inspect the current graphic state (see PDFWriterImpl::updateGraphicsState() for what's going on there regarding clip), and then prune the bitmaps written to pdf down to what's not clipped away.
Comment 2 Fernand 2012-02-22 02:13:04 UTC
The chooise between cropped and non-cropped would be ideal
Comment 3 Samuel Mehrbrodt 2013-04-21 15:22:42 UTC
This enhancement would be really useful. I support it via Freedomsponsors: http://www.freedomsponsors.org/core/issue/246/add-option-to-crop-images-in-pdf-export
Comment 4 Arthur Maciejewicz 2013-06-24 04:38:37 UTC
I am beginning work on this issue.
Comment 5 Björn Michaelsen 2013-10-04 18:47:13 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 6 Jorendc 2014-01-21 10:22:11 UTC
(In reply to comment #4)
> I am beginning work on this issue.

@Arthur: any progression on this one? Still working on it?
If not, please mind to reset the 'assigned to' field, so others can have a look.

Kind regards,
Joren
Comment 7 Fernand 2014-06-22 07:11:58 UTC
>> Dag Cor welkom hier 
In the mean time i have writen this option in Basic who is a bit slow because i replace al cropped images by new images (with the cropped size an the propper resolution). For better quality i can use ImageMagic or when quality is less important, the LO graphicfilter who produce sometimes less quality conversions.
If someone is interested i can post the code here
Comment 8 Cor Nouws 2014-06-22 21:03:38 UTC
(In reply to comment #7)
> >> Dag Cor welkom hier 

Didn't we meet before in BugZilla :) There are numerous issues that I commented or reported ;)

> If someone is interested i can post the code here

Thanks for the kind offering Fernand - I'll remember this.
Comment 9 Daniel Miranda 2014-10-14 04:09:34 UTC
I plan to work on this, but I'd like some clarifications first. Is cropping the only desired feature, or is automatic resizing/resampling of non-cropped images wanted well? I can grasp the PDFWrite without much difficulty, but I don't know how would be the best way to provide UI toggles, or where their corresponding code should be. Any assistance would be appreciated.
Comment 10 Fernand 2014-10-14 05:54:45 UTC
Daniel,

Thanks for the interest  to improve LO to make better (more professional) PDF.
IN LO we ca do everyting needend to produce high quality documents, books, magazines etc. The link to Professional printers is still PDF.
Here we are talking about the storing of images in the resulting PDF.
2 options:
Full Image who permit to re-edit this image in the PDF.
Cropped Size off the Image who delivers smaller PDF

Resampling is a separeted thing and can now allready been done when using the API and macro to produce the PDF (filter options).
But The Resampling is not present in the current GUI and can been ussefull as well.

I Suppose there can been more done to make smaller, leaner PDF also

Storing, a PDFdocument as a Image (not a OLE object) in LO documents would also been a greath improvement !

Greetz

Fernand
Comment 11 Samuel Mehrbrodt 2014-10-14 11:46:53 UTC
@Daniel: You could start by adding support for cropping.
I would turn it on by default and add an option to toggle it off under the "Image" options in the pdf export dialog.

Please ask if you need code pointers - you can also join IRC and ask there!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.