iOS printing to a printer on the network



  • Hello,

    I'm trying to make an iOS application that can "automatically" print pictures to a printer that's on the network. I'm fairly new to iOS and Qt but so far I've not been able to find out how to do the printing. I found some examples that show me how I can use bonjour (https://doc.qt.io/archives/qq/qq23-bonjour.html), I think I can more or less find my printer like this but I couldn't find any help so far on how to use QPrinter to automatically connect to that printer.
    Basically my code so far is essentially:

    QPrinter printer;
    printer.setOutputFormat(QPrinter::NativeFormat);
    printer.setPrinterName("Canon SELPHY CP1200");
    QPainter painter;
    if(!painter.begin(&printer))
    {
      //failed, we actually hit this at the moment
      return 1;
    }
    painter.drawText(10, 10, "Test !");
    painter.end();
    

    I think the problem is that I need to somehow connect the device to my Canon printer somehow but I don't know how to do that. Any insight would be greatly appreciated :)

    Cheers!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.