(self, boletoDados, x, y)
return (self.widthCanhoto,
            ((linhaInicial + 2) * self.heightLine))
Imprime o Recibo do Sacado para modelo de carnê

    :param boletoDados: Objeto com os dados do boleto a ser preenchido.
        Deve ser subclasse de :class:`pyboleto.data.BoletoData`
    :type boletoDados: :class:`pyboleto.data.BoletoData`
Imprime o Recibo do Sacado para modelo de carnê
Imprime o Recibo do Sacado para modelo de carnê
def _drawReciboSacadoCanhoto(self, boletoDados, x, y):
    """Imprime o Recibo do Sacado para modelo de carnê

    :param boletoDados: Objeto com os dados do boleto a ser preenchido.
        Deve ser subclasse de :class:`pyboleto.data.BoletoData`
    :type boletoDados: :class:`pyboleto.data.BoletoData`

    """

    self.pdfCanvas.saveState()
    self.pdfCanvas.translate(x, y)

    linhaInicial = 12

    # Horizontal Lines
    self.pdfCanvas.setLineWidth(2)
    self.__horizontalLine(0, 0, self.widthCanhoto)

    self.pdfCanvas.setLineWidth(1)
    self.__horizontalLine(0,
                          (linhaInicial + 0) * self.heightLine,
                          self.widthCanhoto)
    self.__horizontalLine(0,
                          (linhaInicial + 1) * self.heightLine,
                          self.widthCanhoto)

    self.pdfCanvas.setLineWidth(2)
    self.__horizontalLine(0,
                          (linhaInicial + 2) * self.heightLine,
                          self.widthCanhoto)

    # Vertical Lines
    self.pdfCanvas.setLineWidth(1)
    self.__verticalLine(self.widthCanhoto - (35 * mm),
                        (linhaInicial + 0) * self.heightLine,
                        self.heightLine)
    self.__verticalLine(self.widthCanhoto - (35 * mm),
                        (linhaInicial + 1) * self.heightLine,
                        self.heightLine)

    self.pdfCanvas.setFont('Helvetica-Bold', 6)
    self.pdfCanvas.drawRightString(self.widthCanhoto,
                                   0 * self.heightLine + 3,
                                   'Recibo do Sacado')

    # Titles
    self.pdfCanvas.setFont('Helvetica', 6)
    self.deltaTitle = self.heightLine - (6 + 1)

    self.pdfCanvas.drawString(
      self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.deltaTitle,
      'Nosso Número'
    )
    self.pdfCanvas.drawString(
      self.widthCanhoto - (35 * mm) + self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.deltaTitle,
      'Vencimento'
    )
    self.pdfCanvas.drawString(
      self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'Agência/Código Cedente'
    )
    self.pdfCanvas.drawString(
      self.widthCanhoto - (35 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'Valor Documento'
    )

    # Values
    self.pdfCanvas.setFont('Helvetica', 9)
    heighFont = 9 + 1

    valorDocumento = self._formataValorParaExibir(
      boletoDados.valor_documento
    )

    self.pdfCanvas.drawString(
      self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.space,
      boletoDados.format_nosso_numero()
    )
    self.pdfCanvas.drawString(
      self.widthCanhoto - (35 * mm) + self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.space,
      boletoDados.data_vencimento.strftime('%d/%m/%Y')
    )
    self.pdfCanvas.drawString(
      self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      boletoDados.agencia_conta_cedente
    )
    self.pdfCanvas.drawString(
      self.widthCanhoto - (35 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      valorDocumento
    )

    demonstrativo = boletoDados.demonstrativo[0:12]
    for i in range(len(demonstrativo)):
      self.pdfCanvas.drawString(
        2 * self.space,
        (((linhaInicial - 1) * self.heightLine)) - (i * heighFont),
        demonstrativo[i][0:55]
      )

    self.pdfCanvas.restoreState()

    return (self.widthCanhoto,
            ((linhaInicial + 2) * self.heightLine))
def _drawReciboSacadoCanhoto ( self , boletoDados , x , y ) : self . pdfCanvas . saveState ( ) self . pdfCanvas . translate ( x , y ) linhaInicial = 12 # Horizontal Lines self . pdfCanvas . setLineWidth ( 2 ) self . __horizontalLine ( 0 , 0 , self . widthCanhoto ) self . pdfCanvas . setLineWidth ( 1 ) self . __horizontalLine ( 0 , ( linhaInicial + 0 ) * self . heightLine , self . widthCanhoto ) self . __horizontalLine ( 0 , ( linhaInicial + 1 ) * self . heightLine , self . widthCanhoto ) self . pdfCanvas . setLineWidth ( 2 ) self . __horizontalLine ( 0 , ( linhaInicial + 2 ) * self . heightLine , self . widthCanhoto ) # Vertical Lines self . pdfCanvas . setLineWidth ( 1 ) self . __verticalLine ( self . widthCanhoto - ( 35 * mm ) , ( linhaInicial + 0 ) * self . heightLine , self . heightLine ) self . __verticalLine ( self . widthCanhoto - ( 35 * mm ) , ( linhaInicial + 1 ) * self . heightLine , self . heightLine ) self . pdfCanvas . setFont ( 'Helvetica-Bold' , 6 ) self . pdfCanvas . drawRightString ( self . widthCanhoto , 0 * self . heightLine + 3 , 'Recibo do Sacado' ) # Titles self . pdfCanvas . setFont ( 'Helvetica' , 6 ) self . deltaTitle = self . heightLine - ( 6 + 1 ) self . pdfCanvas . drawString ( self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . deltaTitle , 'Nosso Número' ) self . pdfCanvas . drawString ( self . widthCanhoto - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . deltaTitle , 'Vencimento' ) self . pdfCanvas . drawString ( self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'Agência/Código Cedente' ) self . pdfCanvas . drawString ( self . widthCanhoto - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'Valor Documento' ) # Values self . pdfCanvas . setFont ( 'Helvetica' , 9 ) heighFont = 9 + 1 valorDocumento = self . _formataValorParaExibir ( boletoDados . valor_documento ) self . pdfCanvas . drawString ( self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . space , boletoDados . format_nosso_numero ( ) ) self . pdfCanvas . drawString ( self . widthCanhoto - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . space , boletoDados . data_vencimento . strftime ( '%d/%m/%Y' ) ) self . pdfCanvas . drawString ( self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , boletoDados . agencia_conta_cedente ) self . pdfCanvas . drawString ( self . widthCanhoto - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , valorDocumento ) demonstrativo = boletoDados . demonstrativo [ 0 : 12 ] for i in range ( len ( demonstrativo ) ) : self . pdfCanvas . drawString ( 2 * self . space , ( ( ( linhaInicial - 1 ) * self . heightLine ) ) - ( i * heighFont ) , demonstrativo [ i ] [ 0 : 55 ] ) self . pdfCanvas . restoreState ( ) return ( self . widthCanhoto , ( ( linhaInicial + 2 ) * self . heightLine ) )