Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How do you view the HTML source for a Confluence Cloud page?


For the majority of web pages (including Atlassian Community pages), you can right-click in a browser and select View Page Source (or equivalent) to view the underlying HTML of the page. It isn't possible to do this in Confluence (probably because it side-loads the body content after the container page has loaded).

Many of the legacy editor macros that offered style and class fields (for manipulating PDF exports) have been omitted from the Fabric editor, so I need to identify the source tags, classes, and IDs in order to successfully customise my PDF exports.

Does anyone know a straightforward way to display the body source HTML of a Confluence Cloud page? I've tried using Chrome's Inspect function, but the classes and IDs revealed by it often fail to respond to entries made in the PDF export stylesheet.

1 answer

1 accepted

0 votes
Answer accepted

Have you looked at ? This has a link to the default PDF style sheet, which should give you a starting point to identify the classes and IDs.

BTW Confluence content isn't stored as normal HTML, so inspecting via Chrome's developers tools is the way to view the rendered HTML version.

The old editor uses a special XHTML format called "Confluence Storage Format". However, the new editor is using a completely different JSON based approach for storing content, called "Atlassian Document Format ". But if you view those, they don't really contain any styling.

@James Dellow I appreciate your suggestion, thanks. I also appreciate your explanation, thanks again.

Sadly, neither actually helps me, sorry. We have been customizing the PDF-export process for many years using the tools described in the link you shared. That all works fine and dandy, but the unresolved problem we face arising from the change to the Fabric editor is that we are unable to expose the HTML source that is sent to the PDF-export process. To be fair, the format in which the content is stored is immaterial. For the purposes of output (either to a browser or the PDF-export process), Confluence must present its content in standard HTML form that is has cross-browser support. It means that somewhere down the line its storage is converted into HTML tags with classes and IDs. It is that output we wish to access so we can manipulate it in the PDF-export stylesheet.

The PDF-export stylesheet is great for the entries included as standard and those we have been lucky enough to stumble upon, but what about if you want to customise the look of one of the new success-tip panels? While we have been able to identify a class associated with the DIV used to display it, when we customise that class in the stylesheet the change isn't reflected in the exported PDF, so something opaque is happening behind the scenes.

We will keep trying, of course.

James Dellow Community Leader Jan 10, 2020

If you already have this experience, you might want to try the developer community instead of here

However, have you explored what the API can output? i.e.

Also maybe try for some clues? Scroll down to the example.

Failing that, I think you'll need to talk to an Atlassian insider to understand how the PDF exporter is currently working with the new editor and what styling is being used. You might be making an assumption about how how the content is being transformed before being handed to the PDF exporter.

@James Dellow Great suggestions, thanks! I suspect the API is the way to go. I stumbled upon this suggestion in the Confluence Server questions:

Thank you for your kind help.

Like James Dellow likes this

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events