PdfDocument layout [closed]

1

Hello, I want to generate a PDF with the Android PdfDocument class of the size from a letter sheet. The layout I need must have a form and image. With data aligned in the corners such as date, signatures, sections in boxes, footer, etc.

Searching images on the internet I found a layout that resembles what I need, then, basically, how do I generate the following PDF?

    
asked by dan_flo10 17.06.2016 в 16:13
source

1 answer

0
   //Con esto creas un docuemnto pdf de tamaño DIN A4

   PdfDocument document=new PdfDocument();
   PageInfo pageInfo=new PdfDocument.PageInfo.Builder(595,842,paginas).create();

   Page pagina= document.startPage(pageInfo); //Esto crea la página a crear

   Canvas canvas=page.getCanvas();
    Paint paint=new Paint();
//x, y son los puntos donde quieres pintar el titulo y son puntos PostScript

  int x=50;

 int y=50;

    paint.setTextSize(18);

    paint.setColor(Color.BLUE);

    canvas.drawText("TITULO",x,y,paint);

 //pintas más cosas

 document.finishPage(pagina);

It really is a laborious job because you have to do a lot of tests of where to put everything.

    
answered by 09.06.2018 в 22:16