AbdulBazith's avatar

How to make a printout in laravel

Guys iam working with a project Inventory control system.

when a purchase order is done i need to take a print out.

i have a button while viewing the purchase order.

when i click that it should move to printer and make a print.

how to do this?

actually in my old milfarm project what i did is i used barryvdh/laravel-dompdf

i made a separate html file with css. then using the above package, i made it as download.

after that user needs to move to the downloaded location and open it as pdf then they can download.

but this client not need of downloading it as pdf. he need direct print out.

so is there any easy wat to make it direct printout.

else i need to use the same barryvdh/laravel-dompdf

Kindly guys reply and help me please.

0 likes
8 replies
Screenbeetle's avatar
Level 15

Hi @abdulbazith

Using barryvdh/laravel-dompdf have you tried $pdf->stream(); instead of $pdf->download();?

This would open the purchase order as a pdf in the browser without having to download. You can then just click print (and then also save it as a download if you wanted).

My customers either do this or just use a print friendly html page like @Sergiu17 suggested

AbdulBazith's avatar

@sergiu17 thank you for you response.

this worked. but my nav bar also viewing in the print.

i need only the specific center portion of the purchase order

how could i do that? please

AbdulBazith's avatar

@sergiu17 thank you for your response.

i used barryvdh/laravel-dompdf to make that print out.

thats ok for me.

but i need page number for the print out.

i have posted it as separate question if possible answer those also

Refer: https://laracasts.com/discuss/channels/laravel/how-to-give-page-numbers-for-printout-in-barryvdhlaravel-dompdf

and

Refer: https://laracasts.com/discuss/channels/javascript/calculation-problem-in-javascript-showing-nan-error

Kindly reply for these also please

Screenbeetle's avatar

Hi @abdulbazith ... I'll try to look at your other thread today too. Please first select an answer for this thread if your questions is fixed - you have two good answers above.

Please or to participate in this conversation.