Commit graph

41 commits

Author SHA1 Message Date
Jehan
582caf5a4a Issue #2611: Cannot open certain .pdf files in GIMP.
I am unsure of the problem, but it is fixed by using
poppler_document_new_from_gfile() instead of giving the contents of a
GMappedFile to poppler_document_new_from_data().
Using GFile is anyway usually prefered so I don't dig up more and just
make this change.

(cherry picked from commit a89e503054)
2019-01-02 22:58:56 +01:00
Michael Natterer
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
Alexandre Prokoudine
912e9baaa6 file-pdf-load: fix plurals 2018-02-18 14:12:03 +03:00
Jehan
88e6dc46af plug-ins: use a domain on g_set_error().
Without a domain error, glib outputs on console:
> g_error_new_valist: runtime check failed: (domain != 0)
Let's just create a domain error for the file-pdf-load plugin.
2017-09-26 23:48:52 +02:00
Jehan
f4d9aa00f1 Bug 788175 - New string in file-pdf-load.c needs plurals. 2017-09-26 23:43:55 +02:00
Jehan
d5fd67022b plug-ins: add parameters to file-pdf-load2 to load multiple pages.
This is a new API function, so now is the right time to add missing
parameters! This will allow to load a selection of pages, and even to
reorder the document while doing so. Or simply load all pages in the
right order with n_pages <= 0.
2017-09-25 03:26:25 +02:00
Jehan
71450ef7da plug-ins: forgot to typecast the parameter.
Never commit even oneliners when exhausted. This is today's lesson.
2017-09-25 01:53:59 +02:00
Jehan
ce4cc1a768 Bug 787039 - Make clear that the PDF import dialog selects all pages...
... by default.
Even though selecting nothing is equivalent to selecting all in our
code, let's just explicitly select all pages before showing the dialog
so to make this behavior explicit.
2017-09-24 23:56:35 +02:00
Jehan
0f2002c948 plug-ins: check GError domain and code, not the message.
When there is a well-documented GError domain/code, use these,
especially since messages can be localized (not sure if that is the case
for this one, but theoretically it could) and change over time.

Also remove the "nice-to-have" comment on file-pdf-load since we won't
be changing it now, but leave it on file-pdf-load2 parameters which can
still change before 2.10.
2017-09-10 22:57:12 +02:00
Jehan
af8519b208 plug-ins: fixes and review to the previous commit.
- Clean out some C++ style comments (our coding style only accepts
  C-style comments. Anyway these comments were just old useless code).
- A block indentation fix.
- As a guideline, it is better to keep a GError as the last parameter.
- In non-interactive mode, the new procedure must use the value in
  parameter, otherwise passing the password just doesn't work.
2017-09-10 21:55:41 +02:00
Lionel N
8ef7303f7d Bug 787090 - Encrypted PDF support
Fix for non-interative mode so that it doesn't raise any gtk dialogs.
Added a file-pdf-load2 procedure with an extra argument for the password.
2017-09-10 21:02:05 +02:00
Jehan
278c054dd6 plug-ins: gimp_dialog_run() returns int.
Oups my review was not thorough enough!
2017-09-01 13:09:20 +02:00
Lionel N
6b1291747f Open password protected PDF feature
Supports for password protected PDF. When an encrypted PDF is opened, a
dialog box asks for the password.
When an encrypted PDF is opened, a dialog box asks for the password.
The password dialog box loops as long as the password is wrong (or user
hits CANCEL/escape key)

Reviewed and fixed by Jehan.
2017-09-01 12:56:49 +02:00
Michael Natterer
801bd8fb3f plug-ins: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Jehan
ad339d3bad plug-ins: tab cleaning. 2016-11-23 00:39:53 +01:00
Michael Natterer
4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Michael Natterer
6914bbc65f plug-ins: more gimp_spin_button_new() -> gtk_spin_button_new() 2014-06-22 23:01:31 +02:00
Michael Natterer
9dfe9111ef plug-ins: use g_thread_new(), g_thread_create() is deprecated 2012-11-21 01:47:11 +01:00
Michael Muré
9966bcfd13 remove now useless and deprecated g_thread_init
Warning

g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.
2012-05-03 20:44:07 +09:00
Mukund Sivaraman
216470c728 file-pdf-load: Change description and button text 2012-02-02 21:58:47 +05:30
Mukund Sivaraman
4f3da64f55 file-pdf-load: Rearrange code slightly to group the font options statements together 2012-02-02 21:56:30 +05:30
Massimo Valentini
389c73d492 file-pdf-load: Bug 644544: Let GIMP allow to switch off antialiasing in PDF 2012-02-02 21:55:43 +05:30
Michael Natterer
e16de744a5 plug-ins: use g_message, not gimp_message in file-pdf-load
Also, remove the newline and s/pdf/PDF/.
2011-12-07 19:09:31 +01:00
Mukund Sivaraman
8d68ef15e9 file-pdf-load: Return execution error when no pages exist 2011-12-07 18:24:18 +05:30
Karthikeyan S
7f0e71dbf2 file-pdf-load: Fix possible uninitialised variable access
Print a message to the user if poppler returns n_pages = 0.
Return to file open dialog.
This way we prevent uninitialised variable access down the line.
2011-12-07 18:24:18 +05:30
Mukund Sivaraman
50630241de file-pdf-load: Remove punctuation 2011-12-06 21:12:04 +05:30
Mukund Sivaraman
b90de98c11 file-pdf-load: Mark string for translation 2011-12-06 21:04:06 +05:30
Mukund Sivaraman
11ba7411b4 file-pdf-load: Update help text of file-pdf-load 2011-12-06 21:03:02 +05:30
Michael Natterer
0f08e870f4 plug-ins: set the format strings on the PDF loader's resolution menu
so it says "pixels/foo" and not just "foo".
2011-11-18 16:40:49 +01:00
Michael Natterer
dcb4c6e34a plug-ins: use gtk_box_new() 2011-09-30 12:18:24 +02:00
Michael Natterer
1616151b0e libgimp: remove opacity and mode parameters from gimp_layer_new_from_surface()
They are passed as default values in almost all cases, and can simply
be set later if needed.
2011-04-21 21:10:37 +02:00
Mukund Sivaraman
e999122e0b file-pdf-load: Update attribution, removing bogus copyright 2011-04-21 13:57:13 +05:30
Mukund Sivaraman
7bdadd80ba file-pdf-load: Use better API + cleanups
* fixes issues with poppler 0.17 completely
* uses new libgimp API to pass surfaces instead of pixbufs
* uses GTK+ 3 API to convert surfaces to pixbufs where available
2011-04-21 07:48:25 +05:30
Mukund Sivaraman
79f29530bd Bump poppler required version to 0.12.4
The calls that return cairo surfaces are now required, so the
version bump is required.
2011-04-21 06:56:02 +05:30
Mukund Sivaraman
9b3e1c91fd file-pdf-load: Don't use deprecated API (bug #646947) 2011-04-20 18:55:44 +05:30
Mikael Magnusson
8ff66342b8 plug-ins: set progress to 1.0 when done 2011-04-10 19:28:43 +02:00
Michael Natterer
8c4d99f883 Bug 645456 - Inconsistent window (role) naming scheme
Applied patch from Christoph Kappel which adds a "gimp-" prefix to all
plug-in dialog window roles.
2011-04-08 20:31:34 +02:00
Michael Natterer
97a73ea83f app: use gtk_box_pack_start() to pack a dialog's toplevel container
instead of gtk_container_add()'s because otherwise the widget will not
expand in GTK+ 3.x
2011-03-04 10:44:58 +01:00
Michael Natterer
73d7fbedeb plug-ins: port file-pdf-load to GimpUnitComboBox and build it again 2010-10-31 21:38:27 +01:00
Michael Natterer
bbd7ec6b5c plug-ins: port from gimp_image_add_foo() to gimp_image_insert_foo()
I'm sure some plug-ins need to add their items *not* at the toplevel,
but since making plug-ins really tree-aware is a lot more work than
just fixing insert positions, I went for passing -1 as parent in
almost all cases. And because of laziness...
2010-09-06 11:40:46 +02:00
Barak Itkin
7f10c24f4a plug-ins: rename file-pdf to file-pdf-load
Renaming the PDF import plugin to file-pdf load is needed in order to introduce
the new PDF export plugin
2010-08-28 00:09:59 +03:00
Renamed from plug-ins/common/file-pdf.c (Browse further)