Bug Hunting Session
Bug 60478 - Hybrid PDF: Save changes not possible
Summary: Hybrid PDF: Save changes not possible
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
: 64353 94883 (view as bug list)
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2013-02-08 08:51 UTC by Stephan Zietsman
Modified: 2019-02-07 16:24 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
I can't delete a file created with base if i have created a file when it have the "Libre Office Startmenu" (253.17 KB, image/png)
2016-08-09 10:14 UTC, Raul
Details
WinDbg 64 stacktrace and analyze of general input output error (42.47 KB, text/plain)
2016-08-09 14:32 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Zietsman 2013-02-08 08:51:27 UTC
When editing a Hybrid PDF document, changes that have been made cannot be saved (to the document itself).  A new Hybrid PDF must be exported in order to "save" the changes.  I'm using the term 'Hybrid PDF' to describe a PDF file with an embedded OpenDocument.

--==  Steps to reproduce  ==--

Create new Text Document (File -> New -> Text Document)
Enter some text (E.g. 'Hello world')
Export as Hybrid PDF (File -> Export as PDF... -> Select 'Embed OpenDocument file' checkbox -> Export)
Choose filename ('TestHyb') -> Save
Close document (Ctrl+w -> Discard Changes)
Open the Hybrid PDF (Ctrl+o -> TestHyb.pdf -> Open)
Change text (E.g. 'Hello world, how are you?')
Attempt to save changes...

Method 1:
Ctrl+s -> Save
Expected behaviour: Saves as TestHyb.pdf
Actual behaviour: Opens 'Save as' dialogue (incidentally, Hybrid PDF is not an option here)

Method 2:
File -> Export as PDF... -> Select 'Embed OpenDocument file' checkbox -> Export -> Save -> Yes (when asked to overwrite)
Expected behaviour: Saves as TestHyb.pdf
Actual behaviour: Error saving document TestHyb: Write Error. The file could not be written

Method 3:
File -> Export as PDF... -> Select 'Embed OpenDocument file' checkbox -> Export -> Change name to 'TestHyb2' -> Save.  Then manually delete 'TestHyb.pdf' and rename 'TestHyb2.pdf' to 'TestHyb.pdf'

--==  End of reproduction==--

As far as I can tell, the error in Method 2 is caused because the document that will be overwritten is currently open.  I can understand why this is the situation (the file is being exported rather than changes being saved) and to be honest I almost expected it.  However, as Method 3 shows, this makes for clumsy use of the Hybrid PDF feature.

Hybrid PDF makes it possible to have a PDF document that can be editing.  But not having a good mechanism to save changes seems to be a hindrance here.  I'm marking this as Enhancement as it is technically not a bug.  There is also a workaround (Method 3) albeit very clumsy.

Ideally, in this context I'd like to have the "Save" command export the file as Hybrid PDF (PDF file with embedded OpenDocument) instead of opening the "Save as" dialogue.

-- 
Running LibreOffice 3.6.2.2 
Ubuntu 12.10 x64
About: Version 3.6.2.2 (Build ID: 360m1(Build:2))
Comment 1 bfoman (inactive) 2013-05-08 16:18:25 UTC
*** Bug 64353 has been marked as a duplicate of this bug. ***
Comment 2 gyll 2013-05-11 11:04:54 UTC Comment hidden (no-value)
Comment 3 ign_christian 2013-06-18 14:34:17 UTC
> --==  Steps to reproduce  ==--
> 
> Create new Text Document (File -> New -> Text Document)
> Enter some text (E.g. 'Hello world')
> Export as Hybrid PDF (File -> Export as PDF... -> Select 'Embed OpenDocument
> file' checkbox -> Export)
> Choose filename ('TestHyb') -> Save
> Close document (Ctrl+w -> Discard Changes)
> Open the Hybrid PDF (Ctrl+o -> TestHyb.pdf -> Open)

Hm..after that message box opened:
General Error.
General input/output error.

Using LO 4.0.4.2 (Win7 32bit) with Java 1.7.0_21
Comment 4 Stephan Zietsman 2013-06-18 19:54:25 UTC
(In reply to comment #3)
> Hm..after that message box opened:
> General Error.
> General input/output error.

@ign_christian:
I believe that is a different bug (not related to the original post).  Please search the Bugzilla for your specific bug and add your comments to the report.  If you don't find that bug anywhere, you are welcome to file a new bug report.
Comment 5 ign_christian 2013-06-19 03:18:37 UTC
Ok I found a bug related to what I've been experienced that has been reported long time ago: Bug 43364 -> export to hybrid PDF only works if we set ODF file format as default

I also confirming this bug reproducible with Method 1 & 2. Method 3 is a workaround.

Tested on LO 4.0.4.2 (Win7 32bit)
Comment 6 Stephan Zietsman 2013-12-05 20:48:45 UTC
Just tested once more.  The "bug" (or should I say, lack of Enhancement?) still seems to be present in LibreOffice 4.1.

-- 
Running LibreOffice 4.1 in Ubuntu 13.10
About: Version: 4.1.2.3
Build ID: 410m0(Build:3)
Comment 7 for.llogan 2014-03-04 01:30:51 UTC
The bug still exists, I was coming to file it but then found this so I was smart enough not to duplicate it. Also you can check that the Hybrid PDF made using LO when viewed in Adobe Acrobat there is a panel for attachments to the PDF, where it should be attached to, yet it isn't. Also trying to open the file in any way on LO will cause it to have a General IO error. Unless you open it up in draw but it does not provide a good way to actually edit the text.

--
Running LibreOffice 4.1.4.2
Using Windows 7 with all new updates
Comment 8 V Stuart Foote 2015-10-09 04:11:12 UTC
*** Bug 94883 has been marked as a duplicate of this bug. ***
Comment 9 Raul 2016-08-09 10:07:11 UTC
I have the same problem. I can't open with Writer a pdf file created with Writer. I get the Output / imput error.
I using 5.2.0.4 64 BIts
Thanks!
Comment 10 Raul 2016-08-09 10:14:25 UTC
Created attachment 126688 [details]
I can't delete a file created with base if i have created a file when it have the "Libre Office Startmenu"

When i create a file with LibreOffice BASE i can't delete it if the LIbreOffice start menu is located into the tray. 
I'm from Spain and i use the Spanish version of LibreOffice,
I attach a file with the problem.
Comment 11 V Stuart Foote 2016-08-09 13:35:36 UTC
(In reply to Raul from comment #9)
> I have the same problem. I can't open with Writer a pdf file created with
> Writer. I get the Output / imput error.
> I using 5.2.0.4 64 BIts
> Thanks!

Was the PDF Export completed using the "Hybrid PDF (embed ODF document)"? If not the document does not exist within the PDF--it is not a Hybrid PDF-- and you must use the PDF import filters, i.e. Fitle types -> "PDF Portable Document Format (Writer) (*.pdf)".
Comment 12 V Stuart Foote 2016-08-09 13:37:22 UTC
(In reply to Raul from comment #10)
> Created attachment 126688 [details]
> I can't delete a file created with base if i have created a file when it
> have the "Libre Office Startmenu"
> 
> When i create a file with LibreOffice BASE i can't delete it if the
> LIbreOffice start menu is located into the tray. 
> I'm from Spain and i use the Spanish version of LibreOffice,
> I attach a file with the problem.

Not clear this has anything to do with processing "Hybrid PDF", perhaps open a new issue with complete details, steps to reproduce and a sample document.
Comment 13 V Stuart Foote 2016-08-09 14:32:34 UTC
Created attachment 126703 [details]
WinDbg 64 stacktrace and analyze of general input output error

Confirming on Windows 10 Pro 64-bit en-US with
Version: 5.2.0.4 (x64)
Build ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; 
Locale: en-US (en_US)

1. Open a Hybrid PDF created via Writer, back into Writer.
2. make minor edits
3. Export to PDF and verify configuration as a Hybrid PDF
4. LibreOffice notifies of existing PDF file with same name and asks to overwrite
5. OK the overwrite and receive error...

Error saving the document tdf60478_testExport_hybridPDF:
General Error.
General input/output error.

Even if I remove the file-lock for the open pdf file, and attempt to save get the same General input/output error. Unclear of the reason general input output error, but suggests there are issues with file locking in opening the Hybrid to extract the ODF.  Maybe that needs to be a read only action in some sense.

=-note-=
The export/re-export save cycle is appropriate -- LibreOffice is not a PDF editor, and the Hybrid PDF embedding an ODF document is only implemented in LibreOffice (or OpenOffice with extension). Bug 95328 to implement a more visible "attachement" to PDF would expose the ODF to more use cases.

A Save-as action has been rejected because the project "Exports" to PDF, no reason to change that.
Comment 14 V Stuart Foote 2016-08-09 14:36:46 UTC
@David T. -- any thoughts on what the locking process for reading Hybrid PDF that is causing the general input output error when attempting to Export back to the same filename?
Comment 15 Aron Budea 2019-02-07 16:24:56 UTC
Perhaps with Caolán's recent fix to bug 103947 this will be solved as well?