le plugin pdfImport est divisé en 3 parties:
Ces 3 parties sont écrites en haXe et ont leurs sources dans des dossiers différents.
A noter que dans PDFGUI le fichier PHP de définition du plugin (la classe chargée par SILEX) a été directement écrite en PHP pour des raisons de simplicité.
Les trois projets peuvent être compilés grâce au fichier build.hxml dans chacun des répertoires. Les versions compilées sont automatiquement placées dans le répertoire PDFGUI/pdfImport qui peut ainsi être directement copié dans le dossier plugins du serveur SILEX.
Attention: les build.hxml de PDF2SWF et PDFGUIWebService ont besoin du chemin vers le framework haXe de SILEX (typiquement trunk/framework/hx)
Le plugin doit être installé dans plugins/pdfImport
PDF2SWF can be used over a simple HTTP connection. It expects a set of GET parameters. That are the following:
Parameter | Function |
---|---|
leftPageXOffset | The horizontal position of the pages that are on the left. |
leftPageYOffset | The vertical position of the pages that are on the left. |
rightPageXOffset | The horizontal position of the pages that are on the right. |
rightPageYOffset | The vertical position of the pages that are on the right. |
pageWidth | Pages' width. |
pageHeight | Pages' height. |
namePrefix | The prefix of the generated SWFs and JPGs' name. |
swfDirectoryName | The path inside which SWFs and JPGs will be placed. |
publicationName | The name of the publication the PDF file has to be imported into. |
hasCover | Should the publication have a cover? |
hasDoublePage | Should the publication have double pages? (Changes the way pages number are affected) |
pageName | The prefix of page's name. (ex: "page" will generate "page1.xml", "page2.xml"...) |
pathToSWFTools | The pathToSWFTools (useful for system that do not have PATH correctly set). |
pdfFile | The path to the PDF file to be imported (can be relative to the SILEX server's root) |
page | The number of the page to be converted (used only in generatePublicationStructure) |
action | The action to do : either "convertPage" to convert a PDF page into SWF or JPG or "generatePublicationStructure" to generate/modify the corresponding PublicationStructure. |
pageNumber | The number of pages. (Used only in convertPage). |
startPage | The first page to be integrated into the Publication (used only in generatePublicationStructure) |
silexPage | The first SILEX page into which to integrate PDF's pages. (has to be a number) (Used only in generatePublicationStructure) |
layerName | The subLayer into which to include generated SWF/JPG (for example "LAYER"). (used only in generatePublicationStructure) |
importFormat | Either SWF or JPG. |
The convertPage action returns its status by printing some message to the output:
Return Code | Explanation |
---|---|
PageDoesNotExist | This code is returned when the page doesn't exist in the PDF file. |
Done | This code is returned when the page has been successfully converted. |
Error | This code is returned when another error happened. |
PDFGUIWebService can be used over HTTP haXe remoting. It exposes the "Service" interface that is the interface of the pdfGUIWebService.Server class.