Set PDF document title property

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Set PDF document title property

Hoplop
Ok, so i have adoc with header like this:

:notitle:
:front-cover-image: image:title-page-image.png[]

== Section 1
=== Subsection 1.1
etc

I did this, because what i need is title page without any text, only big image, on whole page. It surely working, but the problem is that after creating PDF from it with asciidoctor-pdf document title in PDF metadata is set to "Section1". I suppose it is logical behavior, but how can i set title to another value?
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

habamax
Well, I have no problem with titles:



= Random notes: Here and there
:author: Maxim Kim
:experimental:
:icons: font
:autofit-option:
:source-highlighter: rouge
:rouge-style: github
:revdate: 2018-12-07
:imagesdir: images
:pdf-style: test
:toc:
:doctype: article
:front-cover-image: image:habamax-cover.jpg[]
:notitle:

== asciidoctor

don't insert image link url if file name wasn't created...


image::img_notes_1.png[]

== customer
...
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

mojavelinux
Administrator
In reply to this post by Hoplop
You need to set the document title to blank so that the default value isn't used (which is the first section):

= {blank}
:notitle:
:front-cover-image: image:spec/fixtures/cover.jpg[]

== Section 1
=== Subsection 1.1
etc

On Wed, Oct 23, 2019 at 6:03 AM Hoplop [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Ok, so i have adoc with header like this:

:notitle:
:front-cover-image: image:title-page-image.png[]

== Section 1
=== Subsection 1.1
etc

I did this, because what i need is title page without any text, only big image, on whole page. It surely working, but the problem is that after creating PDF from it with asciidoctor-pdf document title in PDF metadata is set to "Section1". I suppose it is logical behavior, but how can i set title to another value?


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Set-PDF-document-title-property-tp7273.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

habamax
mojavelinux wrote
You need to set the document title to blank so that the default value isn't
used (which is the first section):
Haven't thought about {blank}.

OP wanted non-blank title to be in PDF metadata (bookmarks?) but not in the pdf pages itself, as far as I understood.
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

mojavelinux
Administrator
> OP wanted non-blank title to be in PDF metadata (bookmarks?) but not in the pdf pages itself, as far as I understood.

The presence of the notitle attribute makes it clear that @Hoplop didn't want it in either place, hence my suggestion.

-Dan

--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

habamax
mojavelinux wrote
> The presence of the notitle attribute makes it clear that @Hoplop didn't
want it in either place, hence my suggestion.
@Hoplop clearly doesn't want title page. And at the same time:

hoplop wrote
I suppose it is logical behavior, but how can i set title to another value?
He wanted to set title other than section 1 to a value that would be in PDF metadata.

But anyway, @hoplop can clarify what he meant.
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

mojavelinux
Administrator
> He wanted to set title other than section 1 to a value that would be in PDF metadata.

That can be accomplished by setting the document title to any other value. That's the normal behavior*. If the document title is not specified at all, in the outline, it will use the title of the first section. (If we to revise that behavior, then we need an issue for it).

Best,

-Dan


On Thu, Oct 24, 2019 at 2:02 AM habamax [via Asciidoctor :: Discussion] <[hidden email]> wrote:
mojavelinux wrote
> The presence of the notitle attribute makes it clear that @Hoplop didn't
want it in either place, hence my suggestion.
@Hoplop clearly doesn't want title page. And at the same time:

hoplop wrote
I suppose it is logical behavior, but how can i set title to another value?
He wanted to set title other than section 1 to a value that would be in PDF metadata.

But anyway, @hoplop can clarify what he meant.



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Set-PDF-document-title-property-tp7273p7278.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

Hoplop
What i want is title page without title. Only with background image.
But title must be in document metadata. And its value must be configurable.
Is there a way to achieve that?
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

mojavelinux
Administrator

No, you cannot have a title page and not have the document title. But you can have a cover page, which seems to be what you really want. For example:

= Document Title
:notitle:
:front-cover-image: image:cover.png[]

content starts here

You'll see that "Document Title" only shows up in the outline.

If you want a front cover AND another page that comes after it before the first page of content, you could create a 1-page PDF that uses the background image, then import it at the start of the document. Something like:

= Document Title
:notitle:
:front-cover-image: image:cover.jpg[]

image::background.pdf[]

content starts here

(The only downside to that approach is that the page numbers of off by one).

-Dan

On Thu, Oct 24, 2019 at 3:42 AM Hoplop [via Asciidoctor :: Discussion] <[hidden email]> wrote:
What i want is title page without title. Only with background image.
But title must be in document metadata. And its value must be configurable.
Is there a way to achieve that?


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Set-PDF-document-title-property-tp7273p7280.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Set PDF document title property

Hoplop
Back then i didn't realize that title tag of PDF is set to first section title . I was not using document title at all, i skipped the line

= Document title

The thing is that i create separate .adoc with all settings and include it in beginning of my main document. I set cover page and everything in settings.adoc. Purpose of that is to be able to set same settings in several files.
Then, when i set title in main document just before settings include:

= Document title
include::settings.adoc[]

== Section 1
...
=== Subsection 1.1
...

i get some errors and PDF was generated in strange way: Document title was insert several times in document, before each heading of level 1 (==). So i decided not using document title at all, and only yesterday i realized that metadata title is set to first section title.
Now i tried to set settings about cover page in main file, not in "settings.adoc", like this:

= Document title
:notitle:
:front-cover-image: image:resources/pdf/themes/main-theme/title-page.png[]
include::settings.adoc[]

== Section 1
...
=== Subsection 1.1
...

And it all worked! Yay!