Improvements to PDF Collabora support in Collabora Offjce Online - - PowerPoint PPT Presentation

improvements to pdf
SMART_READER_LITE
LIVE PREVIEW

Improvements to PDF Collabora support in Collabora Offjce Online - - PowerPoint PPT Presentation

Improvements to PDF Collabora support in Collabora Offjce Online OPENSUSE-LIBREOFFICE CONF20 By Toma Vajngerl htups://tomazvajngerl.blogspot.com/ Required Magic advanced technology Co PDF support is gettjng very important as it is a


slide-1
SLIDE 1

Collabora Offjce

OPENSUSE-LIBREOFFICE CONF’20

Required Magic

advanced technology

Improvements to PDF support in Collabora Online

By Tomaž Vajngerl htups://tomazvajngerl.blogspot.com/

slide-2
SLIDE 2

Co

collabora online . org

PDF support is gettjng very important as it is a format that is commonly used for sharing the read-only documents and forms. Good support in LibreOffjce and Collabora Online is therefore a commonly asked feature.

slide-3
SLIDE 3

Co

22/10/20 .. 3

collabora online . org

PDF import in LibreOffjce

Normal PDF import is using Poppler library

  • Converts PDF elements to LibreOffjce shapes
  • Can import the PDF to edit it, then export
  • The fjdelity is compromised
  • Sometjmes fjdelity is more important than the ability to edit
slide-4
SLIDE 4

Co

22/10/20 .. 4

collabora online . org

PDF import in LibreOffjce

Alternatjve, import PDF with PDFium

  • Import a PDF page as graphic object
  • Rendering of the PDF is done with PDFium library
  • Import into Draw – each page in Draw with a full-page PDF graphic
  • Good fjdelity
  • But can not edit the graphic
  • Enabled by a environment variable in LibreOffjce
slide-5
SLIDE 5

Co

22/10/20 .. 5

collabora online . org

PDF import in Collabora Online

Collabora Online

  • Used PDFium import by default
  • Main use to be a PDF viewer
  • But there are some missing features
  • Search (requested by OwnCloud)
  • Annotatjons / Comments (requested out client by Microfocus)
slide-6
SLIDE 6

Co

22/10/20 .. 6

collabora online . org

PDF Search

Implementjng PDF Search

  • PDF pages are graphics, how can we search those?
  • A graphic stjll keeps the PDF in memory, so we can use search with PDFium
  • we use the search in Draw
  • when we discover a PDF graphic, we use PDF search
  • Another issue – how to show selectjon of the found text on a graphic
  • PDFium can tell us the (page relatjve) text rectangle where the text was found
  • implement custom selectjon rectangles that can draws a selectjon over a graphic
  • bject
slide-7
SLIDE 7

Co

22/10/20 .. 7

collabora online . org

PDF Annotatjons in LibreOffjce

PDF Annotatjons

  • Want to annotate the PDF fjles
  • Many kind of annotatjons
  • Text (note), Link, FreeText, Line, Square, Circle, Polygon,

Polyline, Highlight, Underline, Squiggly, Strikeout, Stamp, Caret, Ink, Popup, FileAtuachment, Sound, Movie, Widget, Screen, Printermark, Trapnet, Watermark, Threed, Richmedia, XFAWidget

slide-8
SLIDE 8

Co

22/10/20 .. 8

collabora online . org

PDF Annotatjons in LibreOffjce

Implementatjon of PDF Annotatjons

  • We have comments in Draw, but that covers only text (note) annotatjons
  • Idea implement text (note) PDF annotatjon fjrst
  • On import we read the PDF annotatjons with help of PDFium
  • And add them into the document as Draw comments
slide-9
SLIDE 9

Co

22/10/20 .. 9

collabora online . org

slide-10
SLIDE 10

Co

22/10/20 .. 10

collabora online . org

PDF Annotatjons in LibreOffjce

Changing the Draw comments

  • We change the comments and want to preserve them
  • Use the existjng PDF export
  • There is already support for exportjng the comments as PDF annotatjons
  • Almost, not all propertjes were exported – in partjcular “Modifjcatjon Date”
  • We go full circle import → export → import
  • And we have a test for that
  • Not supported by comments → colours are hardcoded in Draw comments
slide-11
SLIDE 11

Co

22/10/20 .. 11

collabora online . org

PDF Annotatjons in Collabora Online

Implementatjon Collabora Online

  • Extended LOKit
  • Draw in Collabora Online is basic
  • Used only for showing PDF documents for now
  • Need to report comments what comments are present on a Page
  • And have a functjon to add / change / remove an existjng comment
  • Added a icon to show the positjon of the comment
  • This wasn’t present before
  • Show which comment belongs to where
slide-12
SLIDE 12

Co

22/10/20 .. 12

collabora online . org

PDF Annotatjons

Other annotatjons

  • Work in progress...
  • Change the default marker and use custom drawing code
  • With this we can implement most vector graphic PDF annotatjons
  • Polygon, Ink, Line, Square, Circle
  • Text highlight annotatjons
  • Annotate the text – highlight, underline, strikeout
  • We can implement it as vector graphic annotatjon too
slide-13
SLIDE 13

Co

22/10/20 .. 13

collabora online . org

slide-14
SLIDE 14

Thank you for listening!

By Tomaž Vajngerl

htups://tomazvajngerl.blogspot.com/