Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display PDF in external viewer #7

Closed
fadden opened this issue Jan 3, 2024 · 2 comments
Closed

Display PDF in external viewer #7

fadden opened this issue Jan 3, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@fadden
Copy link
Owner

fadden commented Jan 3, 2024

When a PDF file is encountered, usually in a ZIP archive that collects a disk image and documentation together, the file viewer currently dumps the raw file as converted text. It should instead offer the conversion option "Host Image", and put a "view with external program" button in the middle of the display tab. When clicked, the default system viewer is launched, with the PDF in a temp file.

The original CiderPress automatically launched an external viewer for GIF/JPEG with no prompting. I don't think automatically launching the viewer is a good idea, because it would be jarring if you were scrolling through things with the prev/next button, but it might make sense to pop it open if the PDF file were double-clicked (i.e. the viewer is opened with a single item selected).

Update: this would also be useful for files on CD-ROM, e.g. the Opus ][ documentation directory. These have HFS file types; on the Opus ][ disc I see:

  • PDF /CARO: PDF files
  • W8BN/MSWD: Word files
  • RTF /MSWD: RTF files; could be displayed directly in the Rich Text control, but probably better to launch a viewer since they might use fancy formatting or be very large
@fadden fadden added the enhancement New feature or request label Jan 3, 2024
fadden added a commit that referenced this issue Jan 19, 2024
Files are identified by extension, HFS file type, and signature.
The file is extracted into a temp file and handed to the default
viewer for that extension.

Windows doesn't allow you to delete an open file, so if the file
is open in the external program when the file viewer is closed, the
temporary file won't be removed.  We can scan for these at launch
and scrub them, ideally with user confirmation since we can't
absolutely guarantee that we created them.

(Issue #7.)
fadden added a commit that referenced this issue Jan 20, 2024
The file viewer can't clean up its temporary files if an external
viewer still has the file open, so we need to scan for stale temp
files when the program starts.  We're removing "cp2tmp_*" from the
system temporary directory, so it should be safe to remove the files
without user review and confirmation.

The CLI was refusing to export "host image" files, but this seems
wrong.  We now simply extract them as-is.  The GUI was already doing
this.

Fixed a bug where you couldn't export a "host image" file from the
GUI with drag & drop if it was in a file archive.

(Issue #7)
@fadden
Copy link
Owner Author

fadden commented Jan 21, 2024

@fadden
Copy link
Owner Author

fadden commented Mar 6, 2024

Available in v1.0.1.

@fadden fadden closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant