Bug 120240 - Problem creating hyperlink to pdf by drag and drop (it only creates an image of the pdf's first page)
Summary: Problem creating hyperlink to pdf by drag and drop (it only creates an image ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2018-10-01 14:01 UTC by Kaue
Modified: 2025-05-26 05:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaue 2018-10-01 14:01:48 UTC
Description:
Problem creating hyperlink to pdf by drag and drop (it only creates an image of the pdf's first page).

If I do it with a .txt or .odt file it works fine. 
If I do it by clicking on "menu:Insert>Hyperlink...", than pointing the pdf file, it works fine.

Steps to Reproduce:
1-Open the file explorer and locate the PDF file in question. 
2-Make both windows, Writer and explorer visible. 
3-Drag the file icon to the Writer document holding the Ctrl and Shift key before dropping, than release mouse button.



Actual Results:
An image of the pdf's first page is created in the Writer document.

Expected Results:
Create a link to the pdf.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
A fellow at https://ask.libreoffice.org/en/question/167214/problem-creating-hyperlink-to-pdf-by-drag-and-drop/?comment=167236#post-id-167236 pointed me to report it as a bug.
Comment 1 Mike Kaganski 2018-10-02 18:09:30 UTC
Reproducible using Version: 6.1.2.1 (x64)
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 12; OS: Windows 10.0; UI render: default; 
Locale: ru-RU (ru_RU); Calc: group threaded

Holding Shift+Ctrl while dragging a file from Windows Explorer to Writer's text area turns the pointer to an icon indicating creation of a shortcut; when the file is, e.g., ODF or XLSX, the result is a text link pointing to the dragged file; but when the file is PDF, the result is as if no modifier button is used (inserted as image of first page, no link).

This is inconsistent behavior -> bug.
Comment 2 Mike Kaganski 2018-10-02 18:24:12 UTC
Relevant reference to help describing intended behavior: https://help.libreoffice.org/latest/en-US/text/shared/guide/dragdrop.html
Comment 3 Xisco Faulí 2018-10-17 11:03:31 UTC
I think this is not a bug.
PDF files can be inserted as images, thus, if we drag&drop a PDF file, it's inserted as an image, following the same behaviour as if we drag&drop an image.
Same for Ctrl and Shift keys, they will be inserted as linked images instead of embedded ones. PDF just follow the same logic.

IMHO -> NOTABUG
Comment 4 Mike Kaganski 2018-10-17 11:21:43 UTC
(In reply to Xisco Faulí from comment #3)

Well - yes, this appears to work as you explained (the link is indeed created).

Still - this is a matter of least surprise. While it's logical for images, I don't think it's what most users expect when dealing with PDFs. Being multi-page by nature, it's more likely that users would create links to open an external file than that they would try to create a linked "image" from a PDF.

I'd suggest this to become an implementation defect, or an enhancement.
Comment 5 Xisco Faulí 2018-10-17 11:59:01 UTC
so, just for the record, this behaviour changed in 5.3 after https://wiki.documentfoundation.org/ReleaseNotes/5.3#Improvements_in_the_PDF_filter

@Miklos, Could you please comment here?
Comment 6 Miklos Vajna 2018-10-17 12:11:41 UTC
Hrm, so this drag&drop behavior is intended to differ for image types and document types, and PDF is considered an image, not a document (since 5.3) -- is this correct?

What do we do for other multi-page vector formats, like SVG?
Comment 7 Timur 2018-10-25 08:48:18 UTC
Any image or PDF that is inserted via Insert-Image has only 1st page shown. 
That also caused Bug 93067 and Bug 120083.
Looks like we may remove "hyperlink" from the title.
Comment 8 Kaue 2018-10-26 02:50:38 UTC
(In reply to Timur from comment #7)
> Any image or PDF that is inserted via Insert-Image has only 1st page shown. 
> That also caused Bug 93067 and Bug 120083.
> Looks like we may remove "hyperlink" from the title.

But this bug here proposes to make the "create hyperlink" behavior the default when using drag and drop, as happens, for example, with the odt format. In defense of this proposal, I shall argue:

-Argument 1: The general user usually treats pdf and odt files in a similar way, as multi-page text documents. So, the drag and drop behavior should be the same for both formats.
-Argument 2: The general user usually treats pdf and odt files as multi-page text documents. When Drag and dropping (plus pressing Ctrl and Sift) a multi-page text document into the odt text file, one would, most commonly, do that in order to create a hyperlink to the given document, and not to create a non-editable image of it's first page.
-Argument 3: The Drag and Drop without any buttons pressed already creates an image of the pdf's first page, so it doesn't make sense that the "Drag and drop + Ctrl + Shift" (which is widely known as the "create hyperlink" function) do the same thing.
Comment 9 QA Administrators 2019-10-27 03:37:27 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2021-10-27 03:44:18 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2025-05-26 03:11:33 UTC Comment hidden (obsolete)
Comment 12 Mike Kaganski 2025-05-26 05:38:44 UTC
(In reply to Kaue from comment #8)
> -Argument 3: The Drag and Drop without any buttons pressed already creates
> an image of the pdf's first page, so it doesn't make sense that the "Drag
> and drop + Ctrl + Shift" (which is widely known as the "create hyperlink"
> function) do the same thing.

This specific argument doesn't hold. While I, as already said, support the suggestion, the quoted argument misses the point, that currently there *is* a difference between simple drag, and Ctrl-Shift-drag, that the latter doesn't *embed* the PDF, but creates a *linked* image.