# Basic Help on Magazine Layout

**URL:** <https://forum.mupdf.com/t/basic-help-on-magazine-layout/150>\
**Category:** PyMuPDF\
**Created:** [September 9, 2025, 9:45am UTC](https://forum.mupdf.com/t/basic-help-on-magazine-layout/150 "2025-09-09T09:45:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangermouse](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dangermouse](https://forum.mupdf.com/u/dangermouse)\
**Post date:** [September 9, 2025, 9:45am UTC](https://forum.mupdf.com/t/basic-help-on-magazine-layout/150/1 "2025-09-09T09:45:07Z")

</div>

Hi

I am new to pymupdf and not an experienced developer.

I want to create a magazine layout from an HTML file, in 3 column format with a “stand first”, image and “pull quote”. I have got the 3 columns and a “stand first”. I am trying to add an image.

This is the test code I have [direct from the docs]:

_import pymupdf_

_MEDIABOX = pymupdf.paper\_rect(“letter”)_

_WHERE = MEDIABOX + (36, 36, -36, -36)_

_# create story, let it look at script folder for resources_

_story = pymupdf.Story(archive=“.”)_

_body = story.body # access the body of its DOM_

_with body.add\_paragraph() as para:_

```
*# store desired content*

*para.set_font("sans-serif").set_color("blue").add_text("Hello World!")*

```

_# another paragraph for our image:_

_with body.add\_paragraph() as para:_

```
*# store image in another paragraph*

*# para.add_image("world.jpg")*

*para.add_image("image.jpg")*

```

_writer = pymupdf.DocumentWriter(“pymupdf\_output\_11.pdf”)_

_more = 1_

_while more:_

```
*device = writer.begin_page(MEDIABOX)*

*more, \_ = story.place(WHERE)*

*story.draw(device)*

*writer.end_page()*

```

_writer.close()_

What I see in the pdf is:

 ![image](https://canada1.discourse-cdn.com/flex004/uploads/mupdf/original/1X/4b048472e80c199399d346321fb50dfca77405c7.png)

what have i done wrong?

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [September 10, 2025, 12:19pm UTC](https://forum.mupdf.com/t/basic-help-on-magazine-layout/150/2 "2025-09-10T12:19:44Z")

</div>

Welcome @dangermouse !

I’m just going to format your code a bit, I think you are using this example:

```python
import pymupdf

MEDIABOX = pymupdf.paper_rect("letter")
WHERE = MEDIABOX + (36, 36, -36, -36)

# create story, let it look at script folder for resources
story = pymupdf.Story(archive=".")
body = story.body # access the body of its DOM

with body.add_paragraph() as para:
    # store desired content
    para.set_font("sans-serif").set_color("blue").add_text("Hello World!")

# another paragraph for our image:
with body.add_paragraph() as para:
    # store image in another paragraph
    para.add_image("image.jpg")

writer = pymupdf.DocumentWriter("pymupdf_output11.pdf")

more = 1

while more:
    device = writer.begin_page(MEDIABOX)
    more, _ = story.place(WHERE)
    story.draw(device)
    writer.end_page()

writer.close()

```

Does the “image.jpg” resource exist in the same place where you run this script?
