Commit Graph

68 Commits

Author SHA1 Message Date
ecd86145e0 plug-ins: clean up a bit file-pdf-save.
This improves commit bbd5ebbe8a. Several parameters did not need to go
inside draw_layer(). In particular this function should not take care of
filling return values on errors. It should just return a success boolean
with a GError which is processed on the main function. This also allows
proper shortcut to end the loop earlier on the first error.
Also the layer index parameter does not need to be a pointer since it
never requires updates.
Finally declare variables in smaller scopes for cleaner code.

(cherry picked from commit 5b2d89f794)
2019-07-12 00:10:33 +02:00
7278663a98 Issue #1002: Fix for layer groups in PDF export
Added a recursive loop to draw layer children in layer groups. Text
layers in layer groups are now exported correctly.

(cherry picked from commit bbd5ebbe8a)
2019-07-12 00:10:27 +02:00
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
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
34b54971d8 Fix file-pdf-save exports broken vertical text.
(cherry picked from commit f0e585e7ff)
2018-08-06 12:14:08 +02:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
628e9feb19 icons: Bug 759904 revert patch file-pdf-save.c 2016-06-10 13:50:45 +02:00
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
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
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
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
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
7d3aafe323 file-pdf-save: Fix param index (Bug #736281) 2014-09-26 00:20:01 +05:30
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
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
d0c67f84c8 plug-ins: file-pdf-save needs two return values now for the error message 2014-05-01 20:27:10 +02:00
cdd78c9b16 Fix typo 2014-05-01 14:59:28 +02:00
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
6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
c44c33f667 plug-ins: forgot gegl_init() in file-pdf-save 2013-01-15 14:25:15 +01:00
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
987d795ab9 plug-ins: port file-pdf-save to GEGL 2012-11-21 18:51:41 +01:00
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
55a9eb0d1a plug-ins: lots of cleanup in file-pdf-save before porting to GEGL 2012-11-21 15:04:15 +01:00
fe19ad9706 Bug 683694 - Spelling errors
Reworded all places that used to say "allows to".
2012-11-11 15:50:25 +01:00
dde1ed4d3c file-save-pdf: Remove redundant code (cppcheck report) 2012-09-06 07:23:05 +05:30
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
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
9092c79ca2 plug-ins: remove unused variable in file-pdf-save.c 2012-02-05 22:27:15 +01:00
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
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
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
0428571010 file-pdf-save: Update help text to match that of file-pdf-load 2011-12-06 21:12:04 +05:30
b9e7198f89 Removed i18n from the list of issues. It's done now. 2011-12-04 03:05:45 +04:00
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
cb61dea8fe plug-ins: fix the PDF save procedures' labels 2011-12-03 23:34:28 +01:00
2a55c1cc52 Menu items from file-pdf-save.c are now translatable 2011-12-04 01:02:30 +04:00
2c4bec813d plug-ins: Properly init international framework 2011-11-30 21:14:16 +01:00