0

Google doc, once published takes the whole screen width. It doesn't look good for reading - long lines are really not user friendly (image below).

Is it possible to limit the content width (eg to max 900px)?

enter image description here

Robert Zaremba
  • 8,081
  • 7
  • 47
  • 78

1 Answers1

1

If you want to manage and limit the content width, you would have to embed the document to a web page as an iframe, following these steps. This way:

  • The margins you set in the document via File > Page setup will be mantained.
  • You can set the width and height of the iframe with the corresponding HTML attributes and with CSS:

For example, if you wanted the iframe to have certain width, you could do the following:

<iframe width="900" src="published-doc-url">

Or, if you want the width to be dynamic, you could, for example, try something on the lines of this answer.

Publish an Apps Script Web App:

An easy way to publish and share this is by deploying an Apps Script Web App:

You would just have to create an HTML file, add the iframe to it, create a script file (.gs) that contains this function:

function doGet() {
  return HtmlService.createHtmlOutputFromFile("your-html-file-name");
}

And finally publish the web app, as explained here.

Reference:

Iamblichus
  • 18,540
  • 2
  • 11
  • 27
  • Thanks for answering. For me this looks like a workaround. I would prefer to directly customize the published web-page, so I don't need to create new apps. https://docs.google.com/document/d/18wxxXYqCFPQYQtBrs6AEO3t07IYNDEwhC8Og9MZh2GY/pub – Robert Zaremba Mar 18 '20 at 12:56
  • 1
    @RobertZaremba Of course it is a workaround, but it's the best I can think of. I don't think you can directly customize the published Doc. – Iamblichus Mar 18 '20 at 13:29