Title: get the pdf file programmaticaly
Last modified: May 18, 2017

---

# get the pdf file programmaticaly

 *  Resolved [simplementNat](https://wordpress.org/support/users/simplementnat/)
 * (@simplementnat)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/get-the-pdf-file-programmaticaly/)
 * Hello,
 * I am writing something to send invoices throw FTP. But I don’t find those PDF
   files.
 * I guess they are generated on the fly and not save, then how can I generate them,
   write them in one file, send them twrow FTP and delete it ?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/get-the-pdf-file-programmaticaly/#post-9166578)
 * Hi! The easiest way is by hooking the `wpo_wcpdf_email_attachment` action. This
   is fired when an attachment is sent by email, you can then copy this file (first
   argument contains the full server path to this file) to FTP.
    [https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/blob/v1.6.5/includes/class-wcpdf-export.php#L641](https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/blob/v1.6.5/includes/class-wcpdf-export.php#L641)
 * There is no ‘simple’ shorthand function for creating a pdf directly. This will
   be much easier in the upcoming 2.0 release, but for now (and after 2.0 too), 
   this hook should work just fine too.
 * Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)

The topic ‘get the pdf file programmaticaly’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [ftp](https://wordpress.org/support/topic-tag/ftp/)
 * [save file](https://wordpress.org/support/topic-tag/save-file/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/get-the-pdf-file-programmaticaly/#post-9166578)
 * Status: resolved