Commit graph

66 commits

Author SHA1 Message Date
Jehan
84ce89a9be Issue #2501: Confusing wording in "Export Image as PDF" dialog.
Nothing said what was going to be the order of the page, except by
testing. Now there will be an explicit text, which will be automatically
updated when checking the "reverse order" box.

(cherry picked from commit afe1de950f)
2018-11-14 13:42:36 +01:00
Jehan
679e341285 Issue #2431: After coloring a selection and exporting to PDF, file...
... only shows the color (and nothing else) when "Convert bitmaps to
vector graphics where possible" was set.

This is because gimp_drawable_histogram() only checks selected pixels.
So let's make sure we work on a duplicate of the image so that we can
safely remove the selection before processing the export.
2018-11-08 15:24:42 +01:00
ONO Yoshio
34b54971d8 Fix file-pdf-save exports broken vertical text.
(cherry picked from commit f0e585e7ff)
2018-08-06 12:14:08 +02:00
Michael Natterer
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
luz.paz
147c09f19e Bug 795161 - Misc. typo fixes in source comments and doxygen
Found via `codespell`
Follow-up to  commit 7fdb963e01
2018-04-18 21:06:57 +02:00
Jehan
538590ed8b plug-ins: s/GimpPluginPrintError/GimpPluginPDFError/
Likely a copy-paste typo. Nothing serious, but since I saw it, let's fix
it.
2017-12-10 05:35:36 +01:00
Jehan
e2d1a57ebd plug-ins: fix comment explaining cairo_save().
Current comment was implying that PDF had some kind of fixed PPI, or
that a 72 PPI was hardcoded in cairo. This is not at all what this is
about. Cairo simply has a concept of user-space coordinates, and from
what I gather, it seems that this is set as "point", the typographical
unit of measure (not as a screen point). In such context, cairo_scale()
is used to update the transformation matrix (which will transform from
user to device units, i.e. pixels) so that we can draw with pixels. In
other words, both the user and device units will be pixels in subsequent
calls.
It turns out that 1 inch == 72 points. This is not a PPI/DPI at all and
the comment was completely misleading.
2017-06-20 00:44:03 +02:00
Jehan
a2b438cc82 plug-ins: fill the background color inconditionally on full image size.
No need to loop through layers, which may be wrong anyway with
layers-as-pages. Also we were using the layer sizes without even
checking their offsets yet filling from (0, 0). This code was flawed in
many aspects.
2017-06-20 00:44:03 +02:00
Lionel N
4a05ddebab Export layers as pages to pdf / Reverse pages order
Added a "Reverse Order" option when "Layers as pages" is checked.
"Layers as pages" option is greyed out if the image has only 1 layer.
2017-06-19 22:16:00 +02:00
Jehan
dd6dab113e Bug 783528 - PDF export ignores layer masks.
Cairo doc is pretty clear about cairo_mask_surface():
> A drawing operator that paints the current source using the alpha
> channel of @surface as a mask
Therefore when creating a mask surface, it must be in one of
CAIRO_FORMAT_* with an alpha channel and the mask data must be copied
into this alpha channel. I chose CAIRO_FORMAT_A8 (a format with alpha
only) which I map to "Y u8" babl format in GEGL so that
gegl_buffer_copy() copies the contents of Y into A.
2017-06-16 16:42:39 +02:00
Jehan
0bd94f172a plug-ins: properly "Apply layer masks before saving" when checked.
The `if` test was inverted. When the option is checked, we don't want to
add the GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS capability so that
gimp_export_image() applies the mask.
This is a first step to fix bug 783528, but it's not finished. Right
now, when the option is unchecked, the mask is simply ignored. We want
to export a PDF mask instead.
2017-06-15 20:58:31 +02:00
Jehan
90219a0208 plug-ins: vectorize and apply-masks checked by default for PDF export.
They used to be TRUE by default but that was overwritten. This has been
fixed in commit c08cf41. Let's bring these defaults back.
2017-06-15 01:09:12 +02:00
Jehan
c8550c9581 plug-ins: create file-pdf-save2 with the additional parameter.
And revert file-pdf-save to its previous signature before commit
d03de52. For compatibility reason, we can't change the signature of a
procedure available in previous stable releases.
Also revert file-pdf-save-multi for the same reason. I don't create a
file-pdf-save-multi2 though even though layers-as-pages could still be
meaningful there (creating a multi-page PDF from several multi-layers
images) but that's likely a special case which can be dealt with later.
Obviously the interactive export will use file-pdf-save2.
2017-06-15 00:48:06 +02:00
Jehan
c08cf41113 plug-ins: only check non-defaut parameters in non-interactive mode.
Otherwise default values are not taken into account in interactive mode.
In particular, we want ignore-hidden to be checked (TRUE) by default,
because this is the most obvious behavior (WYSIWYG).
2017-06-15 00:39:54 +02:00
Lionel N
d03de527a5 Bug 382688 - Export layers as pages to PDF file
Add feature to export multiple layers to multiple pages.
Fixed the deprecated functions.
Fixed how transparent/invisible layers are handled.
2017-06-15 00:39:45 +02:00
Michael Natterer
dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
klausstaedtler
628e9feb19 icons: Bug 759904 revert patch file-pdf-save.c 2016-06-10 13:50:45 +02:00
klausstaedtler
8b1ea3cc13 icons: Bug 759904
add
gimp-cancel
gimp-save

patch
gimpstatusbar.c
fil-pdf-save.c
gimpicons.c
gimpicons.h
2016-06-10 13:50:45 +02:00
Jonathan Tait
3c717ac483 Bug 756030 - file-pdf-save-multi PDB API is mis-specified
file-pdf-save-multi did not honor the PDB array passing standard.
2015-10-08 18:39:20 +02:00
João S. O. Bueno
7829177e3c plug-ins: Apply the context-background color on exporting to pdf
PDF files have no transparency, still, transparent areas of
exported images would always display white, regardless of the
current background color.
(The misbehavior was found while checking BUG #752819,
 but that is a cairo issue and is not fixed by this)
2015-07-25 03:26:56 -03:00
Øyvind Kolås
7e6320497e follow gegl api changes from commit af5361ca8d, with an abyss policy argument
to gegl_buffer_copy.
2015-05-25 01:27:31 +02:00
Massimo Valentini
a215fbda56 Bug 681895: PDF export does not save fonts properly
Set the resolution of the PangoFontMap from which the
PangoContext is created, set cairo font options only
on the PangoContext, explicitely set wrap mode and
do not force a layout height.
2015-01-28 19:31:32 +01:00
Mukund Sivaraman
7d3aafe323 file-pdf-save: Fix param index (Bug #736281) 2014-09-26 00:20:01 +05:30
Jehan
4ae597c586 plug-ins: use standard error on failed file descriptor in file-pdf-save.
The standard message used all over our code is:
"Could not open '%s' for writing: %s".
2014-07-29 16:59:49 +00:00
Jehan
eaa4bf2270 Bug 733824 - PDF export fails without warning if open in other application.
This happens on the Windows platforms in particular where applications
can lock files, preventing GIMP to obtain a file descriptor for writing.
2014-07-29 15:41:34 +00:00
Michael Natterer
d0c67f84c8 plug-ins: file-pdf-save needs two return values now for the error message 2014-05-01 20:27:10 +02:00
Piotr Drąg
cdd78c9b16 Fix typo 2014-05-01 14:59:28 +02:00
Hartmut Kuhse
f6328244a2 Bug 725577 - file-pdf-save fails to export images larger than 32768 pixels
Due to a restriction in libcairo, creating surfaces larger than 32768 pixels
fails, so saving a larger file in gimp  as PDF, is rejected.
2014-04-29 17:37:25 +02:00
Ville Skyttä
6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer
c44c33f667 plug-ins: forgot gegl_init() in file-pdf-save 2013-01-15 14:25:15 +01:00
Michael Henning
c59e569e50 plug-ins: don't free a pointer allocated with g_newa in file-pdf-save
Found using clang's scan-build.
2013-01-09 17:02:43 -05:00
Michael Natterer
987d795ab9 plug-ins: port file-pdf-save to GEGL 2012-11-21 18:51:41 +01:00
Michael Natterer
ee9467d259 plug-ins: more file-pdf-save cleanup, mostly formatting
Also, don't alpha-threshold indexed layers any longer.
2012-11-21 16:18:33 +01:00
Michael Natterer
55a9eb0d1a plug-ins: lots of cleanup in file-pdf-save before porting to GEGL 2012-11-21 15:04:15 +01:00
Michael Natterer
fe19ad9706 Bug 683694 - Spelling errors
Reworded all places that used to say "allows to".
2012-11-11 15:50:25 +01:00
Mukund Sivaraman
dde1ed4d3c file-save-pdf: Remove redundant code (cppcheck report) 2012-09-06 07:23:05 +05:30
Massimo Valentini
d76394775f Bug 677040: PDF export does not appear to handle font size...
...correctly unless image flattened

Font size was wrong unless in pixels and
gimp_drawable_type returns a GimpImageType
2012-06-21 19:04:32 +02:00
Massimo Valentini
be5b969c00 Bug 677637: PDF export plug-in does not work
use g_fopen and cairo_pdf_surface_create_for_stream
to avoid file name encoding issues on Windows.
2012-06-09 15:36:53 +02:00
Michael Natterer
9092c79ca2 plug-ins: remove unused variable in file-pdf-save.c 2012-02-05 22:27:15 +01:00
Barak Itkin
d2076552db Fix the bugs in the conversion from drawables to cairo surfaces.
Most of the code was taken from the print plugin, and it includes iterating
over pixel regions (instead of fetching them at once), correct support for RGBA
(which was buggy previously), etc.
This commit removes the usage of A8 cairo surfaces for GRAY layers, simply
because it seems not to work. This should be investigated and fixed in order
to optimize the file size (by saving gray images as gray).
Also should be checked is why we treat the cairo bpp as 4 when calculating the
pixel locations in RGB cairo buffers. The print plug-in does this and it works,
and when I tried 3 it didn't work. May be because of word alignment...
2011-12-31 03:34:23 +02:00
Barak Itkin
f17b3e9cd7 Remove the Multi-Page PDF export from File->Create
It should be restored later when a more suitable place would be found and
when the user interface will be more friendly
2011-12-31 01:14:38 +02:00
Barak Itkin
d78b38022d Remove the defaults procedured from the PDF export plug-in
This commit refactors the way the arguments are being processed into a much
cleaner code. It also makes the main save procedure the default save handler
instead of the removed defaults procedure - this means the order of its
arguments was changed accordingly.
2011-12-31 01:09:29 +02:00
Mukund Sivaraman
0428571010 file-pdf-save: Update help text to match that of file-pdf-load 2011-12-06 21:12:04 +05:30
Alexandre Prokoudine
b9e7198f89 Removed i18n from the list of issues. It's done now. 2011-12-04 03:05:45 +04:00
Alexandre Prokoudine
4b897a894c Part of a user visible message is moved to a tooltip in file-pdf-save.c 2011-12-04 03:02:56 +04:00
Michael Natterer
cb61dea8fe plug-ins: fix the PDF save procedures' labels 2011-12-03 23:34:28 +01:00
Alexandre Prokoudine
2a55c1cc52 Menu items from file-pdf-save.c are now translatable 2011-12-04 01:02:30 +04:00
Massimo Valentini
2c4bec813d plug-ins: Properly init international framework 2011-11-30 21:14:16 +01:00
Mukund Sivaraman
9bab1671c6 file-pdf-save: Fix punctuation 2011-12-01 01:13:53 +05:30
Mukund Sivaraman
0eccda70c0 file-pdf-save: Mark string for translation 2011-12-01 01:13:11 +05:30