(self, boletoDados, x, y)
return (self.width, ((linhaInicial + 3) * self.heightLine))
Imprime o Recibo do Sacado para modelo de página inteira

    :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 página inteira
Imprime o Recibo do Sacado para modelo de página inteira
def _drawReciboSacado(self, boletoDados, x, y):
    """Imprime o Recibo do Sacado para modelo de página inteira

    :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 = 15

    # Horizontal Lines
    self.pdfCanvas.setLineWidth(1)
    self.__horizontalLine(0,
                          (linhaInicial + 0) * self.heightLine,
                          self.width)
    self.__horizontalLine(0,
                          (linhaInicial + 1) * self.heightLine,
                          self.width)
    self.__horizontalLine(0,
                          (linhaInicial + 2) * self.heightLine,
                          self.width)

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

    # Vertical Lines
    self.pdfCanvas.setLineWidth(1)
    self.__verticalLine(
      self.width - (30 * mm),
      (linhaInicial + 0) * self.heightLine,
      3 * self.heightLine
    )
    self.__verticalLine(
      self.width - (30 * mm) - (35 * mm),
      (linhaInicial + 1) * self.heightLine,
      2 * self.heightLine
    )
    self.__verticalLine(
      self.width - (30 * mm) - (35 * mm) - (40 * mm),
      (linhaInicial + 1) * self.heightLine,
      2 * self.heightLine
    )

    # Head
    self.pdfCanvas.setLineWidth(2)
    self.__verticalLine(40 * mm,
                        (linhaInicial + 3) * self.heightLine,
                        self.heightLine)
    self.__verticalLine(60 * mm,
                        (linhaInicial + 3) * self.heightLine,
                        self.heightLine)

    if boletoDados.logo_image:
      logo_image_path = self._load_image(boletoDados.logo_image)
      self.pdfCanvas.drawImage(
        logo_image_path,
        0, (linhaInicial + 3) * self.heightLine + 3,
        40 * mm,
        self.heightLine,
        preserveAspectRatio=True,
        anchor='sw'
      )
    self.pdfCanvas.setFont('Helvetica-Bold', 18)
    self.pdfCanvas.drawCentredString(
      50 * mm,
      (linhaInicial + 3) * self.heightLine + 3,
      boletoDados.codigo_dv_banco
    )
    self.pdfCanvas.setFont('Helvetica-Bold', 11.5)
    self.pdfCanvas.drawRightString(
      self.width,
      (linhaInicial + 3) * self.heightLine + 3,
      'Recibo do Sacado'
    )

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

    self.pdfCanvas.drawRightString(
      self.width,
      self.heightLine,
      'Autenticação Mecânica'
    )

    self.pdfCanvas.drawString(
      0,
      (((linhaInicial + 2) * self.heightLine)) + self.deltaTitle,
      'Cedente'
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.deltaTitle,
      'Agência/Código Cedente'
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.deltaTitle,
      'CPF/CNPJ Cedente'
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.deltaTitle,
      'Vencimento'
    )

    self.pdfCanvas.drawString(
      0,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'Sacado')
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'Nosso Número')
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'N. do documento')
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.deltaTitle,
      'Data Documento'
    )

    self.pdfCanvas.drawString(
      0,
      (((linhaInicial + 0) * self.heightLine)) + self.deltaTitle,
      'Endereço Cedente'
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.deltaTitle,
      'Valor Documento'
    )

    self.pdfCanvas.drawString(
      0,
      (((linhaInicial + 0) * self.heightLine - 3 * cm)) +
      self.deltaTitle,
      'Demonstrativo'
    )

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

    self.pdfCanvas.drawString(
      0 + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.space,
      boletoDados.cedente
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.space,
      boletoDados.agencia_conta_cedente
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.space,
      boletoDados.cedente_documento
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 2) * self.heightLine)) + self.space,
      boletoDados.data_vencimento.strftime('%d/%m/%Y')
    )

    # Take care of long field
    sacado0 = unicode(boletoDados.sacado[0])
    while(stringWidth(sacado0,
                      self.pdfCanvas._fontname,
                      self.pdfCanvas._fontsize) > 8.4 * cm):
      #sacado0 = sacado0[:-2] + u'\u2026'
      sacado0 = sacado0[:-4] + u'...'

    self.pdfCanvas.drawString(
      0 + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      sacado0
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) - (40 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      boletoDados.format_nosso_numero()
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) - (35 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      boletoDados.numero_documento
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 1) * self.heightLine)) + self.space,
      boletoDados.data_documento.strftime('%d/%m/%Y')
    )

    valorDocumento = self._formataValorParaExibir(
      boletoDados.valor_documento
    )

    self.pdfCanvas.drawString(
      0 + self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.space,
      boletoDados.cedente_endereco
    )
    self.pdfCanvas.drawString(
      self.width - (30 * mm) + self.space,
      (((linhaInicial + 0) * self.heightLine)) + self.space,
      valorDocumento
    )

    self.pdfCanvas.setFont('Courier', 9)
    demonstrativo = boletoDados.demonstrativo[0:25]
    for i in range(len(demonstrativo)):
      self.pdfCanvas.drawString(
        2 * self.space,
        (-3 * cm + ((linhaInicial + 0) * self.heightLine)) -
        (i * heighFont),
        demonstrativo[i])

    self.pdfCanvas.setFont('Helvetica', 9)

    self.pdfCanvas.restoreState()

    return (self.width, ((linhaInicial + 3) * self.heightLine))
def _drawReciboSacado ( self , boletoDados , x , y ) : self . pdfCanvas . saveState ( ) self . pdfCanvas . translate ( x , y ) linhaInicial = 15 # Horizontal Lines self . pdfCanvas . setLineWidth ( 1 ) self . __horizontalLine ( 0 , ( linhaInicial + 0 ) * self . heightLine , self . width ) self . __horizontalLine ( 0 , ( linhaInicial + 1 ) * self . heightLine , self . width ) self . __horizontalLine ( 0 , ( linhaInicial + 2 ) * self . heightLine , self . width ) self . pdfCanvas . setLineWidth ( 2 ) self . __horizontalLine ( 0 , ( linhaInicial + 3 ) * self . heightLine , self . width ) # Vertical Lines self . pdfCanvas . setLineWidth ( 1 ) self . __verticalLine ( self . width - ( 30 * mm ) , ( linhaInicial + 0 ) * self . heightLine , 3 * self . heightLine ) self . __verticalLine ( self . width - ( 30 * mm ) - ( 35 * mm ) , ( linhaInicial + 1 ) * self . heightLine , 2 * self . heightLine ) self . __verticalLine ( self . width - ( 30 * mm ) - ( 35 * mm ) - ( 40 * mm ) , ( linhaInicial + 1 ) * self . heightLine , 2 * self . heightLine ) # Head self . pdfCanvas . setLineWidth ( 2 ) self . __verticalLine ( 40 * mm , ( linhaInicial + 3 ) * self . heightLine , self . heightLine ) self . __verticalLine ( 60 * mm , ( linhaInicial + 3 ) * self . heightLine , self . heightLine ) if boletoDados . logo_image : logo_image_path = self . _load_image ( boletoDados . logo_image ) self . pdfCanvas . drawImage ( logo_image_path , 0 , ( linhaInicial + 3 ) * self . heightLine + 3 , 40 * mm , self . heightLine , preserveAspectRatio = True , anchor = 'sw' ) self . pdfCanvas . setFont ( 'Helvetica-Bold' , 18 ) self . pdfCanvas . drawCentredString ( 50 * mm , ( linhaInicial + 3 ) * self . heightLine + 3 , boletoDados . codigo_dv_banco ) self . pdfCanvas . setFont ( 'Helvetica-Bold' , 11.5 ) self . pdfCanvas . drawRightString ( self . width , ( linhaInicial + 3 ) * self . heightLine + 3 , 'Recibo do Sacado' ) # Titles self . pdfCanvas . setFont ( 'Helvetica' , 6 ) self . deltaTitle = self . heightLine - ( 6 + 1 ) self . pdfCanvas . drawRightString ( self . width , self . heightLine , 'Autenticação Mecânica' ) self . pdfCanvas . drawString ( 0 , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . deltaTitle , 'Cedente' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) - ( 40 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . deltaTitle , 'Agência/Código Cedente' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . deltaTitle , 'CPF/CNPJ Cedente' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . deltaTitle , 'Vencimento' ) self . pdfCanvas . drawString ( 0 , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'Sacado' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) - ( 40 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'Nosso Número') self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'N. do documento' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . deltaTitle , 'Data Documento' ) self . pdfCanvas . drawString ( 0 , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . deltaTitle , 'Endereço Cedente' ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . deltaTitle , 'Valor Documento' ) self . pdfCanvas . drawString ( 0 , ( ( ( linhaInicial + 0 ) * self . heightLine - 3 * cm ) ) + self . deltaTitle , 'Demonstrativo' ) # Values self . pdfCanvas . setFont ( 'Helvetica' , 9 ) heighFont = 9 + 1 self . pdfCanvas . drawString ( 0 + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . space , boletoDados . cedente ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) - ( 40 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . space , boletoDados . agencia_conta_cedente ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . space , boletoDados . cedente_documento ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 2 ) * self . heightLine ) ) + self . space , boletoDados . data_vencimento . strftime ( '%d/%m/%Y' ) ) # Take care of long field sacado0 = unicode ( boletoDados . sacado [ 0 ] ) while ( stringWidth ( sacado0 , self . pdfCanvas . _fontname , self . pdfCanvas . _fontsize ) > 8.4 * cm ) : #sacado0 = sacado0[:-2] + u'\u2026' sacado0 = sacado0 [ : - 4 ] + u'...' self . pdfCanvas . drawString ( 0 + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , sacado0 ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) - ( 40 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , boletoDados . format_nosso_numero ( ) ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) - ( 35 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , boletoDados . numero_documento ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 1 ) * self . heightLine ) ) + self . space , boletoDados . data_documento . strftime ( '%d/%m/%Y' ) ) valorDocumento = self . _formataValorParaExibir ( boletoDados . valor_documento ) self . pdfCanvas . drawString ( 0 + self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . space , boletoDados . cedente_endereco ) self . pdfCanvas . drawString ( self . width - ( 30 * mm ) + self . space , ( ( ( linhaInicial + 0 ) * self . heightLine ) ) + self . space , valorDocumento ) self . pdfCanvas . setFont ( 'Courier' , 9 ) demonstrativo = boletoDados . demonstrativo [ 0 : 25 ] for i in range ( len ( demonstrativo ) ) : self . pdfCanvas . drawString ( 2 * self . space , ( - 3 * cm + ( ( linhaInicial + 0 ) * self . heightLine ) ) - ( i * heighFont ) , demonstrativo [ i ] ) self . pdfCanvas . setFont ( 'Helvetica' , 9 ) self . pdfCanvas . restoreState ( ) return ( self . width , ( ( linhaInicial + 3 ) * self . heightLine ) )