1 pièce(s) jointe(s)
XPCOM nsIWebBrowserPrint limitation nom de fichier
Bonjour,
J'utilise XUL 1.9, et j'imprime un fichier, mais dans la popup d'impression, le nom du fichier (dont la taille est supérieure à 50 caractères) est tronqué au moment ou je l'enregistre en format PDF. J'obtiens : nomDeMonFichier... (voir la capture attachée)
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| printWithOutputFileName : function(outputFileName, showProgressBar) {
var webBrowserPrint = this.getWebBrowserPrint();
var printSettings = this.getPrintSettings();
printSettings.docURL = "titre";
printSettings.title = outputFileName;
printSettings.showPrintProgress = false;
printSettings.printToFile = true;
printSettings.toFileName = outputFileName;
webBrowserPrint.print(printSettings, nProgressListener);
var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"].getService(Components.interfaces.nsIPrintSettingsService);
PSSVC.savePrintSettingsToPrefs(printSettings, true,printSettings.kInitSaveAll);
PSSVC.savePrintSettingsToPrefs(printSettings, false,printSettings.kInitSavePrinterName);
} |
avec
Code:
1 2 3
| getWebBrowserPrint : function() {
return _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebBrowserPrint);
}, |
Or cela fonctionnait avec la version précédente de XUL. Y-a-t'il une limitation du nombre de caractères pour le nom d'un fichier ?
Merci pour votre aide.