Bug 89727 - Implement an import filter to insert single PDF pages into a document
Summary: Implement an import filter to insert single PDF pages into a document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.3.5.2 release
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.3.0
Keywords:
: 98925 (view as bug list)
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2015-02-27 18:00 UTC by Timothy Miller
Modified: 2020-04-01 13:14 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample PDF image like those I'd want to paste into a slide (23.01 KB, application/pdf)
2015-03-07 23:46 UTC, Timothy Miller
Details
attachement 113962 sample PDF converted from pdf to svg with pdf2svg (115.21 KB, image/svg+xml)
2015-03-08 02:49 UTC, V Stuart Foote
Details
Tools - Options - General, Open-Save Dialogs (50.68 KB, image/jpeg)
2015-03-22 20:53 UTC, V Stuart Foote
Details
Preference window without Use LO Dialogs option (46.14 KB, image/png)
2015-03-22 21:40 UTC, Jérôme Borme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Miller 2015-02-27 18:00:55 UTC
When making LaTeX documents, I do all my images in PDF format, because that works well with pdflatex.  Unfortunately, when I try to insert a PDF into an Impress document, that option is not available.  

I'm using a Mac, and I commonly will open PDFs in Preview, do a rectangular selection, and then paste into PowerPoint, Word, Keynote, etc., etc.  In Impress, only very low-res bitmap gets pasted in.  As a stop-gap, the resolution should be increased, but a proper vector image paste needs to be supported.
Comment 1 V Stuart Foote 2015-02-27 23:57:41 UTC
Not sure why you are working into an Impress document, or what the source of your vector graphic are.

But, if you are starting with a PDF -- Open the PDF into Draw, save the desired page/image as a new ODF drawing (.ODG), insert (or OLE link) the resulting Draw image into Impress--you should get vector on the export or print from Impress.
Comment 2 Timothy Miller 2015-03-07 23:44:49 UTC
I have various images in PDF format produced by things like gnuplot and OmniGraffle.  Also on occasion, I'll make a rectangular selection in Preview and copy/paste.  I have a bias towards using PDFs because I use pdflatex to produce a lot of documents, and it likes that format for images.  I'll attach an example.

Using Keynote, I can insert PDFs into slides, and I can also paste rectangular selections from Preview.

Using PowerPoint, I can "insert picture from file" into a slide, selecting a PDF, although the rectangular selection from Preview doesn't work (it pastes a bitmap instead).

In Impress, there's no option to insert an image from file that's in PDF format at all.  Also, pasting a rectangular selection from Preview inserts an even grainer bitmap.  The fact that PowerPoint doesn't support this properly isn't really a good reason to underperform, however.

I don't see why I should have to go jump through hoops just to insert an image that happens to be in PDF format.  It's bad enough I can't just paste in vector images.
Comment 3 Timothy Miller 2015-03-07 23:46:29 UTC
Created attachment 113962 [details]
Sample PDF image like those I'd want to paste into a slide

No option to select a file like this to insert as an image into Impress.
Comment 4 V Stuart Foote 2015-03-08 02:18:43 UTC
(In reply to Timothy Miller from comment #2)
> I have various images in PDF format produced by things like gnuplot and
> OmniGraffle...

PDF is a document format, not an image format, but it happens to handle single images (vector or bitmap) reasonably well. Conversion of PDF to bitmaps is trivial, extraction to useable vector graphics is just a bit more difficult.

ghostscirpt, imageMagick and pstoedit are all functional on Apple OS X platform.  Internally LibreOffice makes use of each of these when available as a system resource. But they work great as stand alone utilities to covert your images.

> Using Keynote, I can insert PDFs into slides, and I can also paste
> rectangular selections from Preview.
> 

great guess you are set ;-)

> Using PowerPoint, I can "insert picture from file" into a slide, selecting a
> PDF, although the rectangular selection from Preview doesn't work (it pastes
> a bitmap instead).

we don't care...

> 
> In Impress, there's no option to insert an image from file that's in PDF
> format at all.  Also, pasting a rectangular selection from Preview inserts
> an even grainer bitmap.  The fact that PowerPoint doesn't support this
> properly isn't really a good reason to underperform, however.
> 
> I don't see why I should have to go jump through hoops just to insert an
> image that happens to be in PDF format.  

... just happens to be in PDF format?  No, you are *choosing* to save to PDF format, programs you list support other formats. LibreOffice supports everything using filters.

> It's bad enough I can't just paste in vector images.

Sure you can! SVG, WMF, EMF even EPS... but as each is processed by filters, the fidelity of each type can vary depending on how it is implemented.

Sorry, don't see a bug here.  Resolving invalid.
Comment 5 Timothy Miller 2015-03-08 02:45:02 UTC
Maybe PDF support should be considered a feature request, but it's these kinds of missing things (along with numerous other usability bugs I encountered within minutes of trying to use Impress) that makes it hard for professionals and power users to take LibreOffice seriously.  

Do you care about Free Software toppling the dominance of proprietary software or not?  I mean seriously, is this just something you guys muck around with, or do you care about people actually WANTING to use this software?

PDF is used commonly and ubiquitously as an "image format", and LibreOffice's omission of that is just that:  An omission.
Comment 6 V Stuart Foote 2015-03-08 02:49:56 UTC
Created attachment 113964 [details]
attachement 113962 sample PDF converted from pdf to svg with pdf2svg

pdf2svg uses Cairo and Poppler to generate high quality SVG rendering of PDF, a bit of a chore to build all dependencies but worth it.

Some discussion of providing similar to improve PS and EPS handling of bug 67464
Comment 7 V Stuart Foote 2015-03-08 03:10:31 UTC
OK, its an enhancement request now. In the meanwhile you'll just need to adjust your work flow for handling images across the programs you use.

Most hard core Linux and OS X based users have been very happy to adjust their work flow to use the features that are provided for interoperability of ODF formats.

Sheer mass of users on Windows OS will always push things toward MS provided OOXML solutions. But LibreOffice keeps chipping away at that with robust multi-platform development of ODF based suite.  Draw has many flaws compared to other FOSS packages--Inkscape, GIMP, dia, Scribus, etc.--but it produces valid ODF drawings, and has export/import filters for a reasonable number of formats.  

Things could be a lot worse.
Comment 8 V Stuart Foote 2015-03-08 03:31:56 UTC
Interesting tidbit from bug 71497-- you can open PDF into Impress slide(s) currently. It is functional, but UI is a bit convoluted.

Have to set Tools -> Options -> General: Use LibreOffice Dialogs

and then in the Open dialog "File type" drop down, find the stanzas for Impress. At the bottom of the section is PDF - Portable Document Format (Impress) (*.pdf)

Choosing that and opening the PDF will import filter each page of the PDF into multiple slides in Impress.

Individual slides will have the page properties of the PDF. And the Vector elements and text paths on the slide can be individually manipulated, but also as groups objects.

A slide can be resized along with its objects, and can be copied to another presentation as needed.

Not quite the simple insert PDF as if an image of this issue, but works reasonably well.
Comment 9 Jérôme Borme 2015-03-22 19:15:57 UTC
(In reply to V Stuart Foote from comment #8)
> Have to set Tools -> Options -> General: Use LibreOffice Dialogs

I went through all the Tools -> Options UI. and could not find the option. Could you be more specific?

In full detail:
Three tabs were called "General"

Twelve selectable options started with "Use ":
* Use system font for for user interface
* Use hardware acceleration
* Use anti-aliasing
* Use OpenGL for all rendering
* Use text selection cursor in read-only text documents
* Use automatic font color for screen display
* Use system colors for page previews
* Use a java runtime environment
* Use extended types
* Use 'English (USA)' locale for numbers
* Use background cache
* Use printer metrics for document formatting

No clickable option contained the word "Dialog"
Comment 10 V Stuart Foote 2015-03-22 20:53:43 UTC
Created attachment 114251 [details]
Tools - Options - General, Open-Save Dialogs

(In reply to Jérôme Borme from comment #9)
> (In reply to V Stuart Foote from comment #8)
> > Have to set Tools -> Options -> General: Use LibreOffice Dialogs
> 
> I went through all the Tools -> Options UI. and could not find the option.
> Could you be more specific?
>  
Screen clip attached...

Windows/Linux
1. Tools -> Options -> General panel
2. Open/Save Dialogs
3. check box: Use LibreOffice dialogs

for OS X, reach from the Preferences menu.
Comment 11 Jérôme Borme 2015-03-22 21:40:53 UTC
Created attachment 114253 [details]
Preference window without Use LO Dialogs option

Thanks for the screenshot. I do not have this option, as shown on my own screenshot. 

I am using version 4.4.0.3. I activated the "experimental features" (triggers some more menus options) but I do not use java.
Comment 12 V Stuart Foote 2015-03-22 23:00:29 UTC
(In reply to Jérôme Borme from comment #11)
> Created attachment 114253 [details]
> Preference window without Use LO Dialogs option
> 
> Thanks for the screenshot. I do not have this option, as shown on my own
> screenshot. 
> 
> I am using version 4.4.0.3. I activated the "experimental features"
> (triggers some more menus options) but I do not use java.

Any help if you rename, or clear, your user profile?

If not perhaps build LibreOffice from source?

Otherwise, you could install LibreOffice project built package rather than your distro' provided. Gentoo right?
Comment 13 Jérôme Borme 2015-03-22 23:31:55 UTC
I renamed ~/.libreoffice to somethign else, there is no change in the preference box. 

This version was built from source using gentoo-provided compile scripts. My options are either upgrading to 4.4.1.2 (compiled from source) or using the 4.3.5.2 binary provided by the distro. I'll upgrade tomorrow (it will take some compile time).

(In reply to V Stuart Foote from comment #12)
> Any help if you rename, or clear, your user profile?
> 
> If not perhaps build LibreOffice from source?
> 
> Otherwise, you could install LibreOffice project built package rather than
> your distro' provided. Gentoo right?
Comment 14 Jérôme Borme 2015-03-24 12:03:19 UTC
(In reply to V Stuart Foote from comment #8)
> Have to set Tools -> Options -> General: Use LibreOffice Dialogs

After checking I already had the PDF import filter in the File/Open dialog (the "Use libreoffice Dialogs" option does not appear in my Gentoo builds possibly because the libreoffice dialogs are forcefully compiled in due to some of the compile flags).

> A slide can be resized along with its objects, and can be copied to another
> presentation as needed.

After importing a PDF document the way you explain, I used the Format/Page dialog and checked the "Adapt object to the paper format" checkbox. It indeed resized the objects but not the text (the same as when resizing a grouped drawing). Is there an option to scale the font size (and linewidths) together with size changes of a grouped object / the page size?
Comment 15 Jean-Baptiste Faure 2015-07-01 18:10:00 UTC
Looks like a duplicate of bug 32249.

Best regards. JBF
Comment 16 V Stuart Foote 2016-03-28 03:18:55 UTC
*** Bug 98925 has been marked as a duplicate of this bug. ***
Comment 17 V Stuart Foote 2016-05-10 14:24:21 UTC
A need applicable to Impress, Writer, and even Draw. Adjusting summary.
Comment 18 V Stuart Foote 2016-07-02 22:12:50 UTC
@Miklos,

Awsome! Thank you so much...

Tested on RHEL 7.2 with
Version: 5.3.0.0.alpha0+
Build ID: faddbce32ed863bda4238e54dd11df1b468ccd86
CPU Threads: 2; OS Version: Linux 3.10; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-07-01_05:15:51
Locale: en-US (en_US.UTF-8)

Tested PDF insert as image into Draw and Writer, both are well behaved. The ~1px border I noted in https://gerrit.libreoffice.org/#/c/26586/ is fully resolved.

The PDF is being protected on import, and both it and the SVM meta end up in the ODF archive on save.

I think you can go ahead and associate this issue and resolve fixed.

=-ref-=
https://gerrit.libreoffice.org/26586
https://gerrit.libreoffice.org/26628
https://gerrit.libreoffice.org/26695
https://gerrit.libreoffice.org/26706
https://gerrit.libreoffice.org/26724
https://gerrit.libreoffice.org/26739
https://gerrit.libreoffice.org/26743
https://gerrit.libreoffice.org/26755
Comment 19 Miklos Vajna 2016-07-08 08:14:25 UTC
Sorry, I didn't notice there is a bugreport for this. ;-)