[Need immediate help for GSoC project] Implementing FreeText annotation

Albert Astals Cid aacid at kde.org
Sun Mar 18 19:15:23 UTC 2018


El diumenge, 18 de març de 2018, a les 19:42:33 CET, Dileep Sankhla va 
escriure:
> Hello,
> 
> I have some doubts to clear so that I can begin writing my pending GSoC
> proposal parts as soon as possible. Please help me.
> 
> 1.  The existing FreeText annotation in a pdf file can be moved and edited
> in Okular. Is this partial support of FreeText because of the poppler-qt5
> library extends the core poppler? The core poppler implements a SubType
> enum with FreeText in Annot.h whereas not in poppler-qt5.

Honestly I'm going to refer to Oliver here that is the one that proposed the 
project, as far as i can see we do support FreeText annotations, so maybe he 
can highlight what he thinks is missing?

> 
> 2. How does the poppler-qt5 library extend the core poppler? By including
> the header files from the core poppler?

poppler-qt5 doesn't really extend (or at least should not) the functionality 
of poppler core, it just wraps it to make it easier to use from a Qt 
application.

> 3. If the FreeText annotation needs to be implemented in poppler-qt5 then
> should all the code go inside the poppler-qt5's source instead of the core
> poppler one?

No, code needs to go where it belongs, poppler-qt5 should be just glue code.

> This means a new class called "poppler::FreeTextAnnotation" should be added
> and implemented in "poppler-annotation.cc"? This means one should avoid
> using the exisitng partial support for FreeText in core poppler and write
> the new one as the existing also have some bugs? If writing the new code,
> will it collide with the code from the core poppler? Need a basic idea.

Why would you write new code instead of reusing the existing one, that is 
really a very bad idea.

> 
> 4. A very genuine question, how does an annotation class is implemented in
> poppler? 

There's lots of Annotations classes in poppler, just follow the same 
structure.

> This mean does all the code regarding editing, moving, resizing,
> deleting, transparency of background, text color of the FreeText annotation
> should go in poppler codebase? 

Yes, and no. The dialogs, etc dont belong in poppler, they belong into Okular, 
but anything that is PDF specific, yes, it has to go into the poppler 
codebase, because at the end it's the only piece of code that actually knows 
how to do PDF stuff.

> If so, then how does Okular use these
> annotations and what basically goes in various annotation source files in
> Okular codebase? Need a basic idea.

Read the code and make specific questions, i don't think it's really that hard 
to understand. Basically poppler-core -> poppler-qt5 -> okular-poppler-
generator -> okular-core -> okular-ui

Where most of the code is just glue except the poppler-core that knows how to 
do pdf annotation stuff and the okular-ui that knows how to edit "generic 
annotations".

> 
> 5. Regarding the GUI, is it wise to implement a Popup toolbox whenever the
> FreeText annotation is used and the popup toolbox should have options of
> text size, color, and font? Or should all these font settings should only
> be in Settings -> Configure Okular -> Annotations?

I personally don't see the new for a whole new UI, but since Oliver suggested 
the project i'll let him comment :)

> 
> 6. Should unit tests be written when this annotation is implemented?

auto testing is always welcome.

Cheers,
  Albert

> 
> Thanks and Regards
> 
> Dileep Sankhla
> 
> 
>





More information about the Okular-devel mailing list