<p>No, I don't think there's a way of having a "live" pdf open, in the same way as a webpage. </p>

<p>But, what I usually do is just open the pdf template directly in the browser and create the HTML and CSS while using my normal workflow to check how it looks in the browser. This usually get me 95% of the way, and then I can do the final tweaks when I see what dompdf makes of it.</p>

<p>You need a variable <code>order</code> that's an OrderModel to make this work, so I just grab one like this at the top of my template or in my layout:</p>

<pre><code>{% if not order is defined %}
    {% set order = craft.commerce.orders.first() %}
{% endif %}
</code></pre>

<p>And if you want to test with different orders you can get one at random, or a specific one by id. </p>

CC BY-SA 3.0
2016-11-21T18:41:40.730Z
I kinda figured that'd be the case. Your method is good enough - should save some time! Thanks
taylor
CC BY-SA 3.0
2017-11-03T13:40:03.897Z
Fortunately, the _Brave_ Browser does that.
Marcus Scheller
CC BY-SA 3.0
2016-11-20T21:44:51.307Z
2016-11-20T21:44:51.307Z
André Elvan
<p>Is it possible to 'view' an order's PDF rather than download/create it first? I ask because I'm working on PDF templates and I can't figure out how to view the progress/changes I'm making without having to re-download a order PDF everytime. </p>

<templating><plugin-craftcommerce><pdf>
Craft Commerce View Order PDF, Not Download
# Craft Commerce View Order PDF, Not Download

(Asked by: username_0 on 2016-11-20)

Is it possible to 'view' an order's PDF rather than download/create it first? I ask because I'm working on PDF templates and I can't figure out how to view the progress/changes I'm making without having to re-download a order PDF everytime.

**Tags:** templating, plugin-craftcommerce, pdf


---

## 1 answers

### Answer by username_1 on 2016-11-20. Score: 3 | Accepted answer

No, I don't think there's a way of having a "live" pdf open, in the same way as a webpage. 
But, what I usually do is just open the pdf template directly in the browser and create the HTML and CSS while using my normal workflow to check how it looks in the browser. This usually get me 95% of the way, and then I can do the final tweaks when I see what dompdf makes of it.
You need a variable order that's an OrderModel to make this work, so I just grab one like this at the top of my template or in my layout:
{% if not order is defined %}
    {% set order = craft.commerce.orders.first() %}
{% endif %}

And if you want to test with different orders you can get one at random, or a specific one by id.

> **Comments:**
> **username_0**: I kinda figured that'd be the case. Your method is good enough - should save some time! Thanks  
> **username_2**: Fortunately, the _Brave_ Browser does that.  

---

