diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-09-25 23:44:55 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-09-26 00:54:26 -0600 |
| commit | e15ba68f5d9263745c41e5fcfcfea43098f7269b (patch) | |
| tree | 8332f251e1244dd10a6d689c6f6a48b3faad0976 | |
| parent | de4122d630091ac6769ebab727ad26b6a5cc64c1 (diff) | |
rewrite the Asciidoctor Diagram integration section
| -rw-r--r-- | docs/modules/ROOT/pages/image-paths-and-formats.adoc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/modules/ROOT/pages/image-paths-and-formats.adoc b/docs/modules/ROOT/pages/image-paths-and-formats.adoc index 5d545fb6..8251f30d 100644 --- a/docs/modules/ROOT/pages/image-paths-and-formats.adoc +++ b/docs/modules/ROOT/pages/image-paths-and-formats.adoc @@ -23,10 +23,20 @@ Otherwise, the SVG library will fail to process it. == Asciidoctor Diagram integration -Asciidoctor PDF provides seamless integration with Asciidoctor Diagram by setting the `data-uri` attribute by default. -When the `data-uri` attribute is set, Asciidoctor Diagram returns the absolute path to the generated image, which Asciidoctor PDF can then locate. -(This makes sense since technically, Asciidoctor Diagram must embed the image in the document, similar in spirit to the `data-uri` feature for HTML). -This means the input directory and the output directory (and thus the `imagesoutdir`) can differ and Asciidoctor PDF will still be able to locate the generated image. +Asciidoctor PDF provides seamless integration with Asciidoctor Diagram. + +This integration works because Asciidoctor PDF sets the `data-uri` document attribute internally. +When Asciidoctor Diagram detects that this attribute is set, it passes through the absolute path of the generated image, allowing Asciidoctor PDF to locate it. +Although the generated image is written to a file as an interim step, Asciidoctor PDF still embeds that image into the generated document. +Thus, this behavior is consistent with the definition of the `data-uri` attribute. + +When using Asciidoctor Diagram with Asciidoctor PDF, the input directory (`docdir`) and the output directory (`outdir` and, in turn, `imagesoutdir`) can differ and Asciidoctor PDF will still be able to find and embed the generated images. + +Asciidoctor Diagram builds the `imagesoutdir` from the intrinsic `outdir` attribute. +This works if Asciidoctor PDF is writing the output to a file. +If the output is not being written to a file, you can set the `outdir` or `imagesoutdir` attributes explicitly. + +You can change the display size of the image in the PDF using the xref:image-scaling.adoc#pdfwidth[pdfwidth] attribute on the diagram block or macro. == Image formats |
