# PDF scripting help needed

**URL:** <https://forum.inductiveautomation.com/t/pdf-scripting-help-needed/9254>\
**Category:** Ignition\
**Created:** [October 29, 2014, 5:38pm UTC](https://forum.inductiveautomation.com/t/pdf-scripting-help-needed/9254 "2014-10-29T17:38:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfarnes](https://avatars.discourse-cdn.com/v4/letter/d/ea666f/32.png) [@dfarnes](https://forum.inductiveautomation.com/u/dfarnes)\
**Post date:** [October 29, 2014, 5:38pm UTC](https://forum.inductiveautomation.com/t/pdf-scripting-help-needed/9254/1 "2014-10-29T17:38:30Z")

</div>

Hi All,

The following script:

`sku=event.source.parent.getComponent('Dropdown').selectedStringValue
report = event.source.parent.getComponent ('Report Viewer')
bytes = report.getBytesPDF()
filename = "c:\\test\\report.pdf"
system.file.writeFile (filename, bytes)`

successfully writes the file “c:\test\report.pdf” to the disk without additional user intervention, but what I need is to write to a network location in the format: “\x.x.x.x\share\<filename.pdf\>” where the file name is the contents of the “sku” variable above, with the extension “.pdf” tacked on to the end.

Hoping someone can assist with the custom file name portion of the script - setting the file name to the sku variable with a .pdf extension.

Thanks!

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [October 29, 2014, 9:20pm UTC](https://forum.inductiveautomation.com/t/pdf-scripting-help-needed/9254/2 "2014-10-29T21:20:20Z")

</div>

does this work

```auto
sku=event.source.parent.getComponent('Dropdown').selectedStringValue
report = event.source.parent.getComponent ('Report Viewer')
bytes = report.getBytesPDF()
filename = "\\\\x.x.x.x\\share\\"+sku+".pdf"
system.file.writeFile (filename, bytes)
```

---

<div class="post-metadata">

**Author:** ![dfarnes](https://avatars.discourse-cdn.com/v4/letter/d/ea666f/32.png) [@dfarnes](https://forum.inductiveautomation.com/u/dfarnes)\
**Post date:** [November 17, 2014, 10:48pm UTC](https://forum.inductiveautomation.com/t/pdf-scripting-help-needed/9254/3 "2014-11-17T22:48:28Z")

</div>

Jonathan,

That was exactly what I needed, many thanks!
