[Okular-devel] [Bug 159005] Print document with annotations

Troy Rollo kmail at troy.rollo.name
Sat Oct 22 23:55:40 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=159005





--- Comment #13 from Troy Rollo <kmail troy rollo name>  2011-10-22 23:55:38 ---
For a quick and (very) dirty fix, try changing Document::print in Okular as
shown below, and add  "CMakeFiles/okularpart.dir/ui/pagepainter.o
CMakeFiles/okularpart.dir/ui/guiutils.o" and  "-lqimageblitz" to the Link
command for libokularcore.so.1. From the command line, see LD_LIBRARY_PATH to
include the directory with the new libokularcore.so.1 before /lib and /usr/lib,
and run okular.

This is a very quick and dirty fix - I have deliberately not performed some
checks that should be performed, but it is enough to generate (via print to
PDF) PDFs that show the annotations. It will sometimes SEGV after the printing
is done, and there are no guarantees that it will not do so before that.

bool Document::print( QPrinter &printer )
{
    int    pages = d->m_pagesVector.count();
    int page;

    QPainter painter(&printer);

    for (page = 0; page < pages; ++page)
    {
    QRect geom(printer.pageRect());
    Page* pageptr = d->m_pagesVector.value( page, 0 );
    QMap< int, PagePrivate::PixmapObject >::ConstIterator itEnd =
pageptr->d->m_pixmaps.constEnd();
        PixmapRequest *request = new PixmapRequest( itEnd.key(), page,
geom.width(), geom.height(), 1, false );

    request->d->mPage = pageptr;
    d->m_generator->generatePixmap(request);
    PagePainter::paintPageOnPainter(&painter, d->m_pagesVector[page],
PRESENTATION_ID, PagePainter::Annotations, geom.width(), geom.height(), geom);
    if (page < pages)
        printer.newPage();
    }
    return true;
//    return d->m_generator ? d->m_generator->print( printer ) : false;
}

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Okular-devel mailing list