[scribus-dev] importing text from pdf files, technical preview.

JLuc jluc at no-log.org
Thu May 28 07:47:45 UTC 2020


Le 28/05/2020 à 05:45, NASA Jeff a écrit :
> The first option, shown here: https://imgur.com/6n0xPXG imports each section of the text into a textframe and modifies 
> the charStyle and paragraphStyle to support the variations to the fonts and text throughout a particular section. It 
> should be possible to join up textframes in a logical manner, so they support whatever features Scribus enables through 
> this. Text matrices and text scaling currently aren't supported so are not shown. I also intend to try and make this 
> version line by line authentic with the original pdf document even if the layout varies slightly from it (e.g. text 
> justification). This will mean any page/line lookups of text in an index will still be valid.

This is classic  scribus pdf import isnt ?

> The second option, shown here: https://imgur.com/hjL3HBe  is to of overlay a number of textframes each with their own 
> text configurations, all linked together by scribuses ability to link textframes. Scaling can be used to ensure that the 
> text in the textframes starts and finishes in the correct place to link up with the other text frames that have 
> coordinates hardcoded from the pdf file. This version should keep the document as close to the authentic pdf file as 
> possible, but is obviously not so practical to edit.

This is your new text-as-text pdf import, isnt ?

There are many text frames because they each have a specific "text configuration" and there is no texte local-inline 
formating isnt ? So a more practical to edit alternative could be to have some local-inline texte formating and less 
text frames ? Or is it because they definitively can't be recognised as a single text frame object and it would require 
some sort of advanced AI to sort what text should be kept together as a textframe ?

JL


> 
> you can find the code here:
> 
> https://github.com/olivetthered/scribus 
> <https://github.com/olivetthered/scribus?fbclid=IwAR0SIzZ-u4K0nAcDzkNNx9gBAi_5cPlKv9AVgHf9TnJlQZrQT-aYAJ_8Gs4>
> 
> and you can switch between the two different versions by commenting out _flushText(state); on line 3610 of slaoutput.cpp
> 
> There's currently a minor problem with verticle alignment of the text because the bottom margin isn't being taken into 
> account, but that's an easy fix.
> 
> Hopefully, it shouldn't take much longer to get this into a usable state for wider testing and feature requests. To my 
> knowledge, it will make Scribus the only freely available WYSIWYG text editor to support editing of pdf documents text. 
> Inkscape supports text from pdf but isn't really a practical text editor.
> 
> 
> I'm going to take a little break from development for just now while you all have a play around and I familiarize myself 
> with branching in git a bit more.
> 
> 





More information about the scribus-dev mailing list