Error in dompdf formatting

Asked

Viewed 420 times

-1

Good evening everyone, I wonder if anyone can help me with Dompdf. I am using codeigniter and bootstrap as the basis of the projectinserir a descrição da imagem aqui. I need to generate a PDF with a product gallery, the problem is that I can’t force a line break. Items always appear in each other’s freight.

//controller
    public function ImprimirTrabalho(){

        #pesquisando modelo do trabalho
        $pesquisaModelo = $this->Trabalho->trabalho_layout($this->uri->segment(2));
        #passando Modelo do trabalho para a variavel modelo
        $modelo = $pesquisaModelo['0']['layout'];

        ob_start();
        $this->load->view('header_impressao');
        $this->load->view($modelo);
        $pdf = ob_get_clean();

        $this->pdf->loadHtml($pdf);
        // (Optional) Setup the paper size and orientation
        $this->pdf->setPaper('A4', '');
        // Render the HTML as PDF
        $this->pdf->render();
        // Output the generated PDF to Browser
        $this->pdf->stream("",array("Attachment" => false));


    }

Product catalogue diofgudofui diofgudofui diofgudofui diofgudofui

1 answer

0


Good afternoon! For who is going through or will go through the same difficulty here is how I solved. The DOMPF Library works with css 2.1 and ccs 3, so the routine solutions that we implement can cause us problems regarding the positioning of Divs and etc...

The solution for my case was to position the Divs with position: Absolute; each div was in a specific position and made loops of an entire page to generate the PDF d all sheets. One more detail that may be useful: To create edges in css 2.1 the border element: 2px Solid#000; does not work, and you need to use border: thin Solid #000;

Another useful detail was programming the css with the PDF already rendered, since the formatting of the css is displayed differently in hmtl because of css2.1. I hope I contributed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.