ome / ome/figure

PDF & TIFF export in the browser

Open
#6 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
0
Forks
3
Avg merge
1d 5h
Merged PRs (30d)
5

Description

As discussed at https://github.com/ome/figure/issues/1 & mentioned at https://github.com/JaneliaSciComp/fileglancer/pull/323#issuecomment-5130174536
it would be nice if we can generate a PDF (and TIFF?) in the browser, using the images that have already been generated in the figure app.

I started looking into this a while back at https://github.com/ome/omero-figure/pull/452
using jspdf, which seems to still be a leading contender (last release 6 months ago).

Another option is https://github.com/Hopding/pdf-lib but the last release (and commit) there was 5 years ago.
Also reading this reivew promotes https://github.com/pdfme/pdfme which looks nice. Currently maintained, it uses pdf-lib for PDF generation, wrapped with "template" in JSON.

Scoping of proposed changes:

Current functionalities of Figure_To_Pdf.py script:

  • Generates multi-page PDF (includes "info" page)
  • Creates single TIFF files (single page figure) or multiple TIFF files in a zip (multi-page figures)
  • For both PDF and TIFF options, there you can export "with images" which includes original rendered images from OMERO, along with cropped, rotated, resampled images. Useful for providing journals with info on how images were processed.
  • Export to "Image in OMERO" option that automatically creates a new image from a TIFF (without saving the TIFF)
  • All exports (PDF, TIFF, zips) are saved as annotations on the Image(s) within the figures. The script needs to do this to return the file to the user, so maybe not really a feature.

What would we support/drop?

  • Support multi-page PDF creation
  • Possibly support single TIFF creation? (choose a page at a time to convert) but this would need a whole new export script / library etc.
  • I assume we'd deprecate support for Figure_To_Pdf.py script and export via OMERO scripting service, although we'd have to support this until browser based PDF generation is largely working.

cc @jburel

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Figure_To_Pdf.py script and the browser figure app's export flow. Compare the current PDF and TIFF functionality with the proposed browser-based scope, including multi-page PDF support and the status of TIFF and OMERO scripting exports. Done means the agreed browser export behavior is implemented and verified against those requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.