# Saveas Pdf to a Specific directory

**URL:** <https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672>\
**Category:** General Chat\
**Tags:** graphics, hist, root\
**Created:** [April 13, 2018, 10:27am UTC](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672 "2018-04-13T10:27:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qmalik](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/q/a3d4f5/32.png) [@qmalik](https://root-forum.cern.ch/u/qmalik)\
**Post date:** [April 13, 2018, 10:27am UTC](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672/1 "2018-04-13T10:27:01Z")

</div>

Hello,  
is there any way to save an histogram in pdf format to a specific directory ?  
I am using  
c-\> SaveAs(“clust\_hist.pdf”);  
which saves the histogram to the current directory, but I want to save it in different directory.  
can anyone guide me ?  
thanks

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 13, 2018, 10:47am UTC](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672/2 "2018-04-13T10:47:00Z")

</div>

```auto
c->SaveAs("/full/path/to/clust_hist.pdf");

```

---

<div class="post-metadata">

**Author:** ![qmalik](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/q/a3d4f5/32.png) [@qmalik](https://root-forum.cern.ch/u/qmalik)\
**Post date:** [April 13, 2018, 10:53am UTC](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672/3 "2018-04-13T10:53:52Z")

</div>

Hi,  
Thank you for reply, it worked, 🙂  
but, is there a way to save the file to a variable directory?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 13, 2018, 10:56am UTC](https://root-forum.cern.ch/t/saveas-pdf-to-a-specific-directory/28672/4 "2018-04-13T10:56:38Z")

</div>

[TString::Format](https://root.cern.ch/doc/master/classTString.html#ac34bbb89627e20624a416dfbb7a3db70)
