[scribus] Scientific Document language "WiScri" -> Bunch of bugs/proposals

Gregory Pittman gpittman at iglou.com
Sat Jul 8 23:05:42 UTC 2017


On 07/08/2017 05:54 PM, Jonas Bechtel wrote:
> 
> 6> * You cannot modify pdf links (except changing the document .sla source)
> 
> OK, misunderstanding: you can open some GUI dialog and modify the pdf links, but you cannot do this in Python.
> 
> If it's the same in 1.5.3, it will become a feature request.
> 

In 1.5.4svn (not sure about 1.5.3) there are now Scripter commands for
PDF Annotations, though I'm not sure if these will do what you want. If
they are in 1.5.3, they are probably not documented, since I don't think
I added the documentation until after 1.5.3 was released.

Here is the text from the new manual page:

PDF Annotations
createPdfAnnotation(...)
createPdfAnnotation(type, x, y, w, h, ["name"]) -> string
Creates a new PDF Annotation frame. "type" refers to the kind of PDF
annotation with the following key: (0 PDFBUTTON, 1 PDFRADIOBUTTON, 2
PDFTEXTFIELD, 3 PDFCHECKBOX, 4 PDFCOMBOBOX, 5 PDFLISTBOX, 6
PDFTEXTANNOTATION, 7 PDFLINKANNOTATION, 8 PDF3DANNOTATION). x and y are
the upper left coordinates for the frame, having w width and h height.
If "name" is not given Scribus will create one for you.
On systems without OSG installed a runtime error will be raised. May
raise NameExistsError if you explicitly pass a name that's already used.

isAnnotated(...)
isAnnotated(["name"], ["deannotate=False"]) -> tuple
Queries whether the named or selected object is a PDF annotation.
Returns NONE if it is not. If deannotate=True is included, turns off PDF
annotation flag and returns NONE. If frame is annotation, first value of
tuple is type, and second is any additional information obtainable.
May raise WrongFrameTypeError if object is not a text frame.

setFileAnnotation(...)
setFileAnnotation(path, page, x, y, ["name"], ["absolute=True"])
Converts a text frame to a PDF link annotation to a file. path is the
absolute or relative path to the file. page is the page in the document
to link to, and x and y are the page coordinates. The currently selected
frame will be converted unless another name is given. The default value
for absolute is True, which means the path is absolute; if set to False
the path is relative.
May raise NameExistsError if you explicitly pass a name that doesn't
exist. May raise WrongFrameTypeError if object is not a text frame.

setLinkAnnotation(...)
setLinkAnnotation(page, x, y, ["name"])
Converts a text frame to a PDF link annotation to a page in the current
document. page is the page in the document to link to, and must be in
the range of pages, starting with 1. x and y are the page coordinates.
The currently selected frame will be converted unless another name is given.
May raise NameExistsError if you explicitly pass a name that doesn't
exist. May raise WrongFrameTypeError if object is not a text frame.

setTextAnnotation(...)
setTextAnnotation(icon, isopen, ["name"])
Converts a text frame to a text annotation. icon is a number 0-8 with
the following key: 0 = Note, 1 = Comment, 2 = Key, 3 = Help, 4 =
NewParagraph, 5 = Paragraph, 6 = Insert,7 = Cross, 8 = Circle. isopen is
either True or False. The currently selected frame will be converted
unless another name is given.
May raise NameExistsError if you explicitly pass a name that doesn't
exist. May raise WrongFrameTypeError if object is not a text frame.

setURIAnnotation(...)
setURIAnnotation(uri, ["name"])
Converts a text frame to a PDF URI link annotation. uri is the uri to
link to. The currently selected frame will be converted unless another
name is given.
May raise NameExistsError if you explicitly pass a name that doesn't
exist. May raise WrongFrameTypeError if object is not a text frame.

Greg



More information about the scribus mailing list