2016-10-24 7 views
1

Je souhaite imprimer directement sur une imprimante d'étiquettes jointe sans afficher la boîte de dialogue d'impression.Impression Xojo sans imprimante Boîte de dialogue

J'ai cherché pour voir si une telle chose est possible mais il semble que ce ne soit pas le cas. Donc, j'ai pensé que je demanderais ici au cas où quelqu'un connaîtrait un moyen de le faire.

Répondre

1

Vous devez enregistrer l'imprimante SetupString. Ensuite, la prochaine fois que vous allez imprimer, utilisez cette chaîne SetupString pour initialiser l'objet PrinterSetup. Voir le code réel copié du projet de travail ci-dessous:

'Now print the mail barcode 
    dim ps as PrinterSetup 
    dim page as Graphics 
    ps = LabelPrinter //See below 
    if ps<>nil then 
    page = OpenPrinter(ps) 
    if page<>nil then 
     //send stuff to the printer here 



Public Function LabelPrinter() as PrinterSetup 
    if gLabelSetup<>"" then //gLabelSetup is saved in preferences 
    dim ps as new PrinterSetup 
    ps.SetupString = gLabelSetup 
    return ps 
    else 
    return nil 
    end if 
End Function 
+0

Oh, ouais. En fait, j'avais fait cela il y a plusieurs années et j'ai complètement oublié comment. Merci pour le code et le rappel! –