Title: generating pdfs within wordpress
Last modified: August 19, 2016

---

# generating pdfs within wordpress

 *  Resolved [roakin](https://wordpress.org/support/users/roakin/)
 * (@roakin)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/generating-pdfs-within-wordpress/)
 * hi, i’m using wordpress as a kind of shop management system and therefore i’ve
   developed a custom plugin. now i need to generate some pdf (with ordered products
   and such stuff) but i don’t know how i can generate pdfs within wordpress. i 
   tried to use fpdf but of course wordpress has already sent some header information
   and so this fails
 *     ```
       require('../fpdf.php');
       $pdf=new FPDF();
       $pdf->AddPage();
       $pdf->SetFont('Arial','B',16);
       $pdf->Cell(40,10,'Hello World!');
       $pdf->Output();
       ```
   
 * another possibility is to build a new file which generates the pdf. but this 
   pdf cannot be linked in my plugin and so i wonder how to query the database. 
   of course i could establish a new database conneciont but i hope there’s a better
   solution. any hints for me?
 * thanks a lot

The topic ‘generating pdfs within wordpress’ is closed to new replies.

## Tags

 * [pdf](https://wordpress.org/support/topic-tag/pdf/)

 * 0 replies
 * 1 participant
 * Last reply from: [roakin](https://wordpress.org/support/users/roakin/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/generating-pdfs-within-wordpress/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
