23
Introduction Expanding Okular Okular Simply a document viewer? Pino Toscano, [email protected] June 30th, 2007 Pino Toscano, [email protected] — Okular 1/23

Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, [email protected] — Okular 7/23. Introduction Expanding Okular

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

OkularSimply a document viewer?

Pino Toscano, [email protected]

June 30th, 2007

Pino Toscano, [email protected] — Okular 1/23

Page 2: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Outline

1 Introduction

2 Expanding Okular

Pino Toscano, [email protected] — Okular 2/23

Page 3: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Outline

1 Introduction

2 Expanding Okular

Pino Toscano, [email protected] — Okular 3/23

Page 4: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

What is okular?

The KDE 4 document viewer

Included with kdegraphics.Based on the awarded technology called KPDF.

Different document types in a single application

No more need for different applications to read different typesof documents.

Reading aids

Different ways to ease the reading of a document.

Pino Toscano, [email protected] — Okular 4/23

Page 5: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

FeaturesWhat does okular bring to the user?

“Old“ KPDF features . . .

ThumbnailsFiltering by text search

Table of Contents

Links and hyperlinks

Presentation mode

Customizable viewSingle/facing, continuous

Text extraction

Pino Toscano, [email protected] — Okular 5/23

Page 6: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Features (2)What does okular bring to the user?

. . . and new features

Multicolumns view

Pages rotation

Annotations

Bookmarks

Preliminary forms supportno ActionScript, no possibility to submit

Embedded files in documents

Multimedia (sounds) support

And much more . . .

Pino Toscano, [email protected] — Okular 6/23

Page 7: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

!okularWhat okular is not

A document manipulator (a.l.a. pdftk)

A document collector (a.l.a. digiKam)

An image viewer

Pino Toscano, [email protected] — Okular 7/23

Page 8: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

FormatsThe supported document formats

PDF PostScriptOpenDocument Text DVITIFF DjVuCHM XPSComickBook FictionBookPlucker images

Pino Toscano, [email protected] — Okular 8/23

Page 9: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

OpenUsability.orgThe collaboration with OpenUsability.org

Continuous collaboration with the OpenUsability.orgproject, thanks to the great help of Florian Grassle

KPDF 0.5 got already many usability fixes

Many of the new solutions were developed taking intoaccount usability

Okular and the Summer Of Usability

Okular took part in the recent SoU contest

An Indian student, Sharad Baliyan, was selected

Results so far:

surveys about user interfacea proposal about the toolbar

Pino Toscano, [email protected] — Okular 9/23

Page 10: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

PeopleThe people behind Okular

Pino Toscano

Albert Astals Cid

Tobias Konig

Brad Hards

Luigi Toscano

Jiri Klement

Piotr Szymanski

Florian Grassle

Pino Toscano, [email protected] — Okular 10/23

Page 11: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

FuturePlanned work on Okular

Better support of forms

Better handling or annotations

Possible integration with Nepomuk/Strigi

OpenDocument generator using the KOffice/Flake library

More and better document supports

Pino Toscano, [email protected] — Okular 11/23

Page 12: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Outline

1 Introduction

2 Expanding Okular

Pino Toscano, [email protected] — Okular 12/23

Page 13: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIIntroduction

Okular provides a public API for writing generators fordocument types.

Why writing an Okular backend?

No worries about the view of the documentThink about writing a “model“. . .

Common UI for reading the documentSingle place for usability enhancements and fixes

New features and bugfixes become available for free forany generator

Pino Toscano, [email protected] — Okular 13/23

Page 14: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIGeneral structure of the Okular API

CorelibraryGUI

Generators

Poppler

DjVu

. . .

Pino Toscano, [email protected] — Okular 14/23

Page 15: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APICore classes

All in the Okular namespace.

Document

Page

Generator & TextDocumentGenerator

PixmapRequest

Action & its hierarchy

TextPage

Annotation & its hierarchy

FormField & its hierarchy

. . .

Pino Toscano, [email protected] — Okular 15/23

Page 16: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIBase API

Okular::Generator

bool loadDocument(const QString &fileName,

QVector<Okular::Page*> &pagesVector);

bool closeDocument();

Easy job: opening a document and loading the pages from it.

Should also add all the page objects to the Page.

Pino Toscano, [email protected] — Okular 16/23

Page 17: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIPage rendering

protected:

QImage image(PixmapRequest *page);

synchronous

activating the Threaded feature may help. . .

Own rendering strategy

bool canGeneratePixmap() const;

void generatePixmap(PixmapRequest *request);

image() is not needed in this case

Pino Toscano, [email protected] — Okular 17/23

Page 18: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIText extraction

protected:

TextPage* textPage(Page *page);

sync/async depending on the type

Own text extraction strategy

bool canGenerateTextPage() const;

void generateTextPage(Page *page, GenerationType

type);

textPage() is not needed in this case

Pino Toscano, [email protected] — Okular 18/23

Page 19: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIMetadata

general document information(generateDocumentInfo())

table of contents (generateDocumentSynopsis())

Fonts in the document (generateDocumentFonts())

Embedded files (embeddedFiles())

DRM (isAllowed())

. . . and metaData() for any other kind of metadata

Pino Toscano, [email protected] — Okular 19/23

Page 20: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIGive me paper!

Implementing the printing

bool print(KPrinter &printer);

synchronous (no workaround at the moment)

printer has all the needed stuff (size, margins, etc. . . )

printing configuration via PrintInterface

Pino Toscano, [email protected] — Okular 20/23

Page 21: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIBasic generator example

class SimpleGenerator : Okular::Generator() {public:

SimpleGenerator();

~ SimpleGenerator();

bool loadDocument(

const QString &fileName,

QVector<Okular::Page*> &pages) {// open the document, fill the pages vector

return whether the loading succeeded;

}bool closeDocument() {// cleanup your open document

return true;

} };Pino Toscano, [email protected] — Okular 21/23

Page 22: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

Okular APIGenerator examples (2)

Example of more “complicated“ generators (TIFF & Poppler)

Pino Toscano, [email protected] — Okular 22/23

Page 23: Okular - Simply a document viewer? · 2020. 2. 10. · A document collector (a.l.a. digiKam) An image viewer Pino Toscano, pino@kde.org — Okular 7/23. Introduction Expanding Okular

Introduction Expanding Okular

QuestionsAnything to ask?

Questions ?

Pino Toscano and the Okular [email protected]

Pino Toscano, [email protected] — Okular 23/23