Scribus Forums

Scribus => Scripts and Plugins => Topic started by: superspy on January 30, 2014, 10:12:54 AM

Title: getText with styles
Post by: superspy on January 30, 2014, 10:12:54 AM
Hi

I'm trying to use the getAllText() function to get the text from a frame and put it into another document.
It works, BUT...formatting is lost. Is there a way to preserve formatting?

Or alternatively is there a way to copy an entire text box with styling via a script.

Thanks in advance
Title: Re: getText with styles
Post by: ismir on April 07, 2014, 01:01:28 AM
Hi,

you can use getFont (in a while loop through all the textframes where you get the text with getText)


font = scribus.getFont(item[0])


and when you paste your collected text in a single textframe use


scribus.setText(my_collected_text_var, item[0])
scribus.setFont(font, item[0])


item in this example is the varible given from scribus.getPageItems()
the items are textframes when item[1] == 4

regards