PDFedit user documentation - Appendix
Table of Contents
I. Scripting API documentation for PDF Editor
1. Static functions common for GUI and command line
Annotation createAnnotation(double[4] rect,string type);
IProperty createArray()
IProperty createBool(bool value)
PdfOperator createCompositeOperator(string beginText,string endText)
IProperty createDict()
PdfOperator createEmptyOperator()
IProperty createInt(int value)
IPropertyArray createIPropertyArray()
IProperty createName(string value)
PdfOperator createOperator(string text,IPropertyArray parameters)
PdfOperatorStack createPdfOperatorStack()
IProperty createReal(double value)
IProperty createRef(int valueNum,int valueGen)
IProperty createString(string value)
bool delinearize(string inFile,string outFile)
string error()
bool exists(string chkFileName)
bool flatten(string inFile,string outFile)
string[] functions(bool includeSignatures)
string loadFile(string name)
Pdf loadPdf(string name,bool advancedMode, bool askPassword=true)
string[] objects()
string pdftoxml (string inFile, Variant pagenums, string outFile)
void print(string str)
double rand()
void run(string scriptName,bool skipScriptPath)
bool saveFile(string name, string content)
bool saveRawFile(string name, ByteArray content)
void setDebugLevel(string param)
string time(string format)
int tick()
Variant transformationMatrixDiv(Variant oldCTM,Variant newCTM)
Variant transformationMatrixMul(Variant ma,Variant mb)
Variant transformationMatrixMul(double a0,double a1,Variant mb)
string tr(string text,string context)
void treeNeedReload()
string utf8(string original)
string[] variables()
string version()
2. Static functions in GUI
void processEvents()
string askPassword(string title)
void setItemText(string name,string newText)
string getItemText(string name)
void about()
void addAnnotation(Page page,double x1,double y1,double w,double h)
void addObjectDialog(IProperty container)
void checkItem(string name,bool check)
void clearConsole()
void closeAll()
bool closeFile(bool askSave,bool onlyAsk)
void createMenuItem(string parentName,string name,string caption,string action,string accel,string icon,string[] classes=QStringList())
void createNewWindow()
void enableItem(string name,bool enable)
string filename()
string fileOpenDialog()
string fileSaveDialog(string oldName)
string fileSaveDialogDiffer(string origName)
string fileSaveDialogXml(string oldName)
Color getColor(string colorName);
string getEditText(string textName)
double getNumber(string name)
void help(string topic)
bool isVisible(string widgetName)
void message(string msg)
Variant mergeDialog()
Variant selectPagesDialog (string filename) const
bool modified()
bool openFile(string name, bool askPassword=true)
void openFileNew(string name)
void options()
Page page()
int pageNumber()
Color pickColor();
Menu popupMenu(string menuName)
bool question(string msg)
int question_ync(string msg)
void restoreWindowState()
bool save()
bool saveCopy(string name)
bool saveRevision()
void saveWindowState()
void setColor(string colorName,Variant newColor)
void setEditText(string textName,string newText)
void setNumber(string name,double number)
void setPredefs(string name,string predefs)
void setTooltip(string name,string tip)
void setPredefs(string name,string[] predefs)
void setRevision(int revision)
void setVisible(string widgetName, bool visible)
void showItem(string name,bool show)
TreeItem treeRoot()
TreeItem treeRootMain()
void warn(string str)
TreeItem firstSelectedItem(string name)
TreeItem nextSelectedItem()
CObject firstSelected(string name)
CObject nextSelected()
QProgressBar * progressBar()
3. Static functions in command line
void exit(int returnCode=0)
string[] parameters()
string takeParameter()
4. Callback functions
onChangeRevision()
onConsoleStart()
onEmptyFile()
onLoad()
onLoadUser()
onLoadError()
onPageChange()
onPageDelete()
onPageRightClick()
onTreeLeftClick()
onTreeRightClick()
onTreeMiddleClick()
onTreeDoubleClick()
onTreeSelectionChange()
onValueChange(name)
5. Objects exported to scripting
settings
string settings.read(string key,string default=NULL)
bool settings.readBool(string key,bool default=false)
string settings.readExpand(string key,string default=NULL)
string settings.expand(string)
string settings.write(string key,string value)
string settings.remove(string key)
void settings.flush()
Document-related objects in scripting
document
6. Object types (common and PDF objects)
Annotation
Dict getDictionary()
Page getPage()
bool remove()
string getType()
string getTypeName()
Array
void add(int index,IProperty ip)
void add(int index,string ip)
void add(int index,int ip)
void add(IProperty ip)
void add(string ip)
void add(int ip)
CObject child(string name)
int count()
void delProperty(int index)
string getText()
CObject property(int index)
CObject
string type()
ContentStream
bool equals(QObject* otherObject)
void deleteOperator(PdfOperator op,bool indicateChange=true)
string getText()
void insertOperator(PdfOperator op,PdfOperator newOp,bool indicateChange=true)
void replace(PdfOperator oldOp,PdfOperator newOp,bool indicateChange=true)
void saveChange()
PdfOperator getFirstOperator()
PdfOperator getLastOperator()
bool isEmpty()
Dict
void add(string name,IProperty ip)
void add(string name,string ip)
void add(string name,int ip)
CObject child(string name)
int count()
void delProperty(string name)
bool exist(string name)
string getText()
CObject property(string name)
CObject propertyDef(string name,int defValue)
CObject propertyDef(string name,string defValue)
string[] propertyNames()
IProperty
bool equals(QObject* otherObject)
Variant value()
string getText()
CObject ref()
int getInt()
string getType()
string getTypeName()
void set(string value)
void set(int value)
void set(double value)
void set(bool value)
IPropertyArray
void append(IProperty prop)
void clear()
int count()
CObject property(int index)
Page
void moveAbove(ContentStream cs)
void moveBelow(ContentStream cs)
void moveAbove(int csi)
void moveBelow(int csi)
void addAnnotation(Annotation an)
void setTransformMatrix(Variant tMatrix)
void prependContentStream(PdfOperatorStack opStack)
void appendContentStream(PdfOperatorStack opStack)
string getFontId(string fontName)
string[] getFontIdsAndNames(bool onlyNames)
void addSystemType1Font(string fontName)
ContentStream getContentStream(int streamNumber)
void removeContentStream(int streamNumber)
int getContentStreamCount()
ContentStream getChange(int changeNumber)
int getChangeCount()
void loadContentStreams()
Dict getDictionary()
string getText()
double[] mediabox();
void setMediabox(double x1,double y1,double x2,double y2)
void setMediabox(Rect rc)
Pdf
bool isReadOnly()
bool isEncrypted()
bool isLinearized()
bool needsCredentials()
bool isValid()
void unloadPdf()
bool saveAs(string name)
bool save(bool newRevision)
bool setPassword(string pass)
Dict getDictionary()
void removePage(int position)
int getPagePosition(Page page)
int getPageCount()
Page insertPage(Page page, int position)
Page getPage(int position)
Page getFirstPage()
Page getLastPage()
Page getNextPage(Page page)
Page getPrevPage(Page page)
bool hasNextPage(Page page)
bool hasPrevPage(Page page)
int getRevisionsCount()
int getActualRevision()
PdfOperator
bool equals(QObject* otherObject)
double[4] getBBox ();
PdfOperator getLastOperator()
bool containsNonStrokingOperator()
bool containsStrokingOperator()
PdfOperatorIterator iterator()
PdfOperatorIterator graphicalIterator(bool forwardDir=true)
PdfOperatorIterator inlineImageIterator(bool forwardDir=true)
PdfOperatorIterator textIterator(bool forwardDir=true)
PdfOperatorIterator changeableIterator(bool forwardDir=true)
PdfOperatorIterator strokingIterator(bool forwardDir=true)
PdfOperatorIterator nonStrokingIterator(bool forwardDir=true)
PdfOperatorIterator fontIterator(bool forwardDir=true)
PdfOperatorStack childs()
int childCount()
string getText()
string getEncodedText()
string getName()
IPropertyArray params()
int paramCount()
void pushBack(PdfOperator op,PdfOperator prev)
void remove()
void setNext(PdfOperator op)
void setPrev(PdfOperator op)
PdfOperator clone()
ContentStream stream()
PdfOperatorIterator
PdfOperator current()
PdfOperatorIterator copy()
PdfOperatorIterator next()
PdfOperatorIterator prev()
ContentStream stream()
bool isEnd()
bool isBegin()
bool valid()
PdfOperatorStack
int count()
void append(PdfOperator prop)
void prepend(PdfOperator prop)
CObject first()
CObject last()
void removeFirst()
void removeLast()
CObject element(int index)
Stream
void setBuffer(ByteArray a)
void setBuffer(string s)
void setRawBuffer(ByteArray a)
void setRawBuffer(string s)
bool loadBuffer(string fileName)
bool loadRawBuffer(string fileName)
string getBufferString()
ByteArray getBuffer()
bool saveBuffer(string fileName)
string getDecoded()
ByteArray getRawDecoded()
void add(string name,IProperty ip)
void add(string name,string ip)
void add(string name,int ip)
int count()
void delProperty(string name)
bool exist(string name)
CObject property(string name)
string[] propertyNames()
7. Object types (GUI objects)
Menu
string popup()
void reset()
void addItemDef(string def)
void addItem(string name)
void addSeparator()
TreeItem
void setSelected(bool selected=true)
bool selected()
bool valid()
void setOpen(bool opened)
CObject item()
CObject itemref()
string itemtype()
TreeItem child(string name)
string[] getChildNames()
TreeItem parent()
string id()
string text()
string path()
void reload()
void remove()
TreeItemContentStream
void setMode(string newMode)
string getMode()
8. QSA Utility Framework
File Class Reference
Enums
Static Functions
Constructor
Properties
Member Functions
Dir Class Reference
Enums
Static Properties
Static Functions
Constructor
Properties
Member Functions
Process Class Reference
Static Properties
Static Functions
Constructor
Properties
Member Functions
9. QSA Input Dialog Framework
CheckBox
Properties
ComboBox
Properties
DateEdit
Properties
Dialog
Properties
Functions
GroupBox
Properties
Functions
LineEdit
Properties
NumberEdit
Properties
RadioButton
Properties
SpinBox
Properties
TextEdit
Properties
TimeEdit
Properties
Convenience Classes
The MessageBox class
Button types
Functions
The FileDialog class
Functions
The Input class
Functions