Summary:
This adds support for actions associated with form fields
through corresponding annotation widgets.
Test Plan:
Still needs a unit test, only tested manually with
the document attached in the task.
Reviewers: #okular, aacid
Reviewed By: #okular, aacid
Subscribers: okular-devel, aacid
Tags: #okular
Maniphest Tasks: T8627
Differential Revision: https://phabricator.kde.org/D12665
Summary:
As a side effect of f0a80a67 a recalculation was triggered
by the notifyFormChanges called in EditFormTextCommand::redo,
which is called for each edit. So calculation was done twice.
Test Plan: The calculate forms test still passes.
Reviewers: aacid
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12825
Summary:
Put the file into a file descriptor and open this file descriptor.
Just application/pdf for now.
Test Plan: opened some documents on my phone
Reviewers: #okular, aacid, mart
Reviewed By: mart
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12770
Summary:
This adds support for multiple actions following each
other through the "Next" value of Action dictionaries.
Test Plan: Activates the corresponding part of the visibilitytest.
Reviewers: #okular
Subscribers: sander, aacid
Tags: #okular
Maniphest Tasks: T8278
Differential Revision: https://phabricator.kde.org/D11609
Summary:
This adds the hidden property to JavaScript fields and
uses it to implement support for HideAction.
Test Plan: Unit test in the next commit.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T8274
Differential Revision: https://phabricator.kde.org/D11596
Summary:
The highlights were removed when rotating the page, also the RotaionJob::rotationMatrix function was not rotating the Highlihgts correctly.
I removed the deletion and modified the rotaionMatrix function by making it shorter and adding a translation after the rotatin. I tried different rotations and they are working fine.
BUG: 387282
Reviewers: #okular
Subscribers: aacid, ngraham, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D11901
There's no need to continue generating something that won't be useful.
Also fixes a crash if the request would report partial updates since at that stage it uses the observer and that is gone
The crash would happen because we were setting partial updates to true on requests
that were synchronous, because that sync request was cancelling an async one (prerender)
so now we only set newRequest partial updates to true when cancellingm another one if it's asynchronous
And a sync but with partial updates request would make stuff crash because the request
would all be processed on the main thread but generator_pdf.cpp cakks signalPartialPixmapRequest
with a queued connection so we that function was called the request would have already gone
Summary:
This implements setting / getting the value of buttons,
which is important for checkboxes in scripts. It also moves
the checkbox activate action after the value is set so that
the correct value is used when the activation script is
executed.
Reviewers: #okular
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10868
Summary:
This makes it possible to set the read only state from
scripts. Requires Poppler master with the patch attached to the parent task.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T8097
Differential Revision: https://phabricator.kde.org/D10867
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.
Test Plan:
Tested with simple_calculate example.
Run the unit test with the added line commented out and it failed, with the added line it passes.
Reviewers: #okular
Subscribers: aacid, ltoscano
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10547
Summary:
This starts by adding support for AFSimple_Calculate which
is the standard "calculate" function in Adobe Acrobat Pro.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10049
Summary:
If a field is updated because of a calculate form action /
a script execution, not only refresh the rendered pixmap but
also the corresponding formWidget.
Test Plan: Unittest in separate revision. Tested it manually, too.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10048
Summary:
This adds a new data object "Event" that can be used
to carry information in and out of JavaScript execution
contexts. The Event Object is defined in the Adobe JavaScript
scripting reference.
The implementation now adds handling for the FieldCalculate
Event. It should be extensible enough so that in the future
more events could be supported.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10073
Summary:
Removes old Utils::realDpi function for Mac. The old code employs functions
CGDisplayCurrentMode and CGDisplayIOServicePort, which are deprecated as
of versions 10.6 and 10.9, respectively. Now Mac uses the same code, as
Linux does, since it works out of the box.
This commit automatically fixes the long-standing bug of having an
implementation of realDpiX() and realDpiY(), which are not declared in
the utils.h file.
Reviewers: #okular, rjvbb
Reviewed By: rjvbb
Subscribers: rjvbb, cullmann, aacid, kde-mac, ltoscano, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D10415
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
Summary:
Only supported by the pdf backend if using poppler >= 0.63
Sadly had to change the generator API
Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved
Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263
Reviewers: ervin, rkflx
Reviewed By: ervin, rkflx
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9328
text page was storing a pointer to a PagePrivate pointer but those die
after saving so we need to store a Page pointer since those are stable.
BUGS: 387247
bd20e48c3c updated Okular's copy of the synctex code to 1.19.
Unfortunately since this version the upstream code logs errors like
`"! SyncTeX Error : Ignored record...` when accessing selected synctex
files created with older versions of synctex.
The upstream `_synctex_log` contains `va_list arg` as a parameter, but
fails to initialize and tear down this properly via `va_start` and
`va_end`. In general this seems to work for the single argument case.
However, once we apply our hardening patch to get rid of the
`gnu_printf format attribute` warning and thus introduce a variadic
argument, things go wrong.
To fix this, we add the missing code. The remaining changes are just
refreshing the patches.
BUG: 383915
Test Plan:
Opening `empty.pdf` with `empty.synctex.gz` from
https://bugs.kde.org/attachment.cgi?id=109116 located
in the same folder does not lead to Okular segfaulting anymore.
Summary:
This way pages that take more than 500ms to render get updated every so often so that the
user can see that the program didn't hang, it's just that it's taking long to render
Tags:
incremental rendering, partial updates
BUGS: 344081
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8379
We don't need to delete the threadweaver job, threadweaver does it by itself,
and if we call deleteLater it may happen that the main thread deletes it
and then when the threadweaver thread tries to call the delete things are
gone and it goes kaboom
BUGS: 382725
Summary:
so that pixmap generation gets a chance to start before the text generation
This makes that on files where both the text generation and the pixmap generation
are slow at least we see something "as fast as possible" since only either text generation
or pixmap generation threads run at the same time
Reviewers: #okular, mlaurent
Reviewed By: mlaurent
Subscribers: michaelweghorn, dvratil, mlaurent, #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8378
How does it work:
* What it does is really closing and opening the file again through poppler
* This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
* The annotationmodel needs updating it's pointers
* The widgets for the forms are reused and their form* updated
* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)
TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests