[FF] Automation of PrintPDF

  • Hey. First of all i'm sorry if it already exists but i don't speak any word of deutch, even suscribe to this forum was hard :p
    But as u are the only forum i can get help with FF.au3 i will try to explain best i can.

    For my job i want to export Html to PDF, but with really specifics needs. The Firefox extension PrintPDF 0.76 appears the only one able to do this perfectly.
    But i need to automate this export, so i thought to FF.au3 as i saw you could automate other extensions.

    But i don't now a lot FF.au3 and it _FFCMd(), so is it possible to have help?
    here is the start:

    [autoit]

    Func _export_pdf($url)
    _FFStart($url,"default",2,True) ; Not visible
    If _FFIsConnected() Then
    ;...
    EndIf
    EndFunc

    [/autoit]

    PrintPDF appears in the "Menu Bar" in Firefox : File -> Export to PDF
    Is it possible?

    Thx a lot for help,
    Tim

  • I don't think its possible to control other addons with ff.au3 (not sure about this...). But as you describe it (I don't know this addon) you don't need ff.au3 to control it. Instead you could use normal window control functions to select entry from FF file menu. The necessary window handle of FF should be available with:

    [autoit]

    $handle = _FFWindowGetHandle()

    [/autoit]

    After that you should be able to use:

    [autoit]


    WinMenuSelectItem($handle,...)

    [/autoit]
  • Thx a lot for help.
    Hmmm i tried what u said, and now its the next step ihave got troubles.

    With _FFGetObjectInfo() i found an object "printpdf".

    After, with _FFGetObjectInfo("printpdf") i found this:

    "[0]|getPrintingPrefs|[function]
    [1]|initialized|true
    [2]|onLoad|[function]
    [3]|onMenuItemCommand|[function]
    [4]|onToolbarButtonCommand|[function]
    [5]|prefs|[object]
    [6]|strings|[object]"

    Here is the _FFGetObjectInfo("printpdf.prefs") :

    Spoiler anzeigen

    [0]|clearUserPref|[function]
    [1]|deleteBranch|[function]
    [2]|getBoolPref|[function]
    [3]|getCharPref|[function]
    [4]|getChildList|[function]
    [5]|getComplexValue|[function]
    [6]|getIntPref|[function]
    [7]|getPrefType|[function]
    [8]|lockPref|[function]
    [9]|PREF_BOOL|128
    [10]|PREF_INT|64
    [11]|PREF_INVALID|0
    [12]|PREF_STRING|32
    [13]|prefHasUserValue|[function]
    [14]|prefIsLocked|[function]
    [15]|QueryInterface|[function]
    [16]|resetBranch|[function]
    [17]|root|extensions.printpdf@pavlov.
    [18]|setBoolPref|[function]
    [19]|setCharPref|[function]
    [20]|setComplexValue|[function]
    [21]|setIntPref|[function]
    [22]|unlockPref|[function]

    And here is the _FFGetObjectInfo("printpdf.strings") :

    Spoiler anzeigen

    "[0]|_bundle|[object]
    [1]|addEventListener|[function]
    [2]|align|
    [3]|allowEvents|false
    [4]|appendChild|[function]
    [5]|ATTRIBUTE_NODE|2
    [6]|attributes|[object]
    [7]|baseURI|chrome://browser/content/browser.xul
    [8]|blur|[function]
    [9]|boxObject|[object]
    [10]|builder|null
    [11]|CDATA_SECTION_NODE|4
    [12]|childElementCount|0
    [13]|childNodes|[object]
    [14]|children|[object]
    [15]|classList|[object]
    [16]|className|
    [17]|click|[function]
    [18]|clientHeight|0
    [19]|clientLeft|0
    [20]|clientTop|0
    [21]|clientWidth|0
    [22]|cloneNode|[function]
    [23]|collapsed|false
    [24]|COMMENT_NODE|8
    [25]|compareDocumentPosition|[function]
    [26]|contextMenu|
    [27]|controllers|[object]
    [28]|database|null
    [29]|datasources|
    [30]|dir|
    [31]|dispatchEvent|[function]
    [32]|doCommand|[function]
    [33]|DOCUMENT_FRAGMENT_NODE|11
    [34]|DOCUMENT_NODE|9
    [35]|DOCUMENT_POSITION_CONTAINED_BY|16
    [36]|DOCUMENT_POSITION_CONTAINS|8
    [37]|DOCUMENT_POSITION_DISCONNECTED|1
    [38]|DOCUMENT_POSITION_FOLLOWING|4
    [39]|DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|32
    [40]|DOCUMENT_POSITION_PRECEDING|2
    [41]|DOCUMENT_TYPE_NODE|10
    [42]|ELEMENT_NODE|1
    [43]|ENTITY_NODE|6
    [44]|ENTITY_REFERENCE_NODE|5
    [45]|firstChild|null
    [46]|firstElementChild|null
    [47]|flex|
    [48]|flexGroup|
    [49]|focus|[function]
    [50]|getAttribute|[function]
    [51]|getAttributeNode|[function]
    [52]|getAttributeNodeNS|[function]
    [53]|getAttributeNS|[function]
    [54]|getBoundingClientRect|[function]
    [55]|getClientRects|[function]
    [56]|getElementsByAttribute|[function]
    [57]|getElementsByAttributeNS|[function]
    [58]|getElementsByClassName|[function]
    [59]|getElementsByTagName|[function]
    [60]|getElementsByTagNameNS|[function]
    [61]|getFeature|[function]
    [62]|getFormattedString|[function]
    [63]|getString|[function]
    [64]|getUserData|[function]
    [65]|hasAttribute|[function]
    [66]|hasAttributeNS|[function]
    [67]|hasAttributes|[function]
    [68]|hasChildNodes|[function]
    [69]|height|
    [70]|hidden|true
    [71]|id|printpdf-strings
    [72]|insertBefore|[function]
    [73]|isDefaultNamespace|[function]
    [74]|isEqualNode|[function]
    [75]|isSameNode|[function]
    [76]|isSupported|[function]
    [77]|lastChild|null
    [78]|lastElementChild|null
    [79]|left|
    [80]|localName|stringbundle
    [81]|lookupNamespaceURI|[function]
    [82]|lookupPrefix|[function]
    [83]|maxHeight|
    [84]|maxWidth|
    [85]|menu|
    [86]|minHeight|
    [87]|minWidth|
    [88]|mozMatchesSelector|[function]
    [89]|namespaceURI|http://www.mozilla.org/keymaster/gate…ere.is.only.xul
    [90]|nextElementSibling|[object]
    [91]|nextSibling|[object]
    [92]|nodeName|stringbundle
    [93]|nodeType|1
    [94]|nodeValue|null
    [95]|normalize|[function]
    [96]|NOTATION_NODE|12
    [97]|observes|
    [98]|ordinal|
    [99]|orient|
    [100]|ownerDocument|[object]
    [101]|pack|
    [102]|parentNode|[object]
    [103]|persist|
    [104]|prefix|null
    [105]|previousElementSibling|[object]
    [106]|previousSibling|[object]
    [107]|PROCESSING_INSTRUCTION_NODE|7
    [108]|querySelector|[function]
    [109]|querySelectorAll|[function]
    [110]|ref|
    [111]|releaseCapture|[function]
    [112]|removeAttribute|[function]
    [113]|removeAttributeNode|[function]
    [114]|removeAttributeNS|[function]
    [115]|removeChild|[function]
    [116]|removeEventListener|[function]
    [117]|replaceChild|[function]
    [118]|resource|[object]
    [119]|scrollHeight|0
    [120]|scrollLeft|0
    [121]|scrollTop|0
    [122]|scrollWidth|0
    [123]|setAttribute|[function]
    [124]|setAttributeNode|[function]
    [125]|setAttributeNodeNS|[function]
    [126]|setAttributeNS|[function]
    [127]|setCapture|[function]
    [128]|setUserData|[function]
    [129]|src|chrome://printpdf/locale/printpdf.properties
    [130]|statusText|
    [131]|stringBundle|[object]
    [132]|strings|[object]
    [133]|style|[object]
    [134]|tagName|stringbundle
    [135]|TEXT_NODE|3
    [136]|textContent|
    [137]|tooltip|
    [138]|tooltipText|
    [139]|top|
    [140]|width|


    "
    So, i tried this :

    _FFCmd("printpdf.onMenuItemCommand()")

    Words quite well since i got a window who asks me where i want to put the pdf file:
    ScreenShot :

    [Blockierte Grafik: http://usb-online.fr/file-download-f10MTA2Mw.html]

    But if it's possible, i don't want to have this windows, i want to give the file path in a property (if possible) and directly generate PDF file.
    I seem to not be able to found by myself, maybe u will find the right key.

    I tryed ;

    [autoit]

    _FFCmd("printpdf.strings.hidden=true")

    [/autoit]

    , but seems to not work.

    Thx again for your help.

    edit: Found spoiler :p