asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

Add disclaimer usage to title page #2466

Closed gxurma closed 8 months ago

gxurma commented 8 months ago

Hi guys! Since years I work for companies which need stupid lengthy legal disclaimers on their title page of their documents. I would like to add this now Please revise and use it. Can be set where on the title page it shall appear.

Also added example in the default theme.

Yours sincerely, Martin Gyurko enGYneer.at

mojavelinux commented 8 months ago

We're not going to add an element to the title page to support a one-off use case. However, you can accomplish this using an extended converter. In fact, you can find an example of this exact customization on the use cases page. See https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#custom-title-page

It would look something like this:

class PDFConverterCustomTitlePage < (Asciidoctor::Converter.for 'pdf')
  register_for 'pdf'

  def ink_title_page doc
    super
    @y = page_height * 0.2
    theme_font :title_page_disclaimer do
      layout_prose (doc.attr 'disclaimer'),
        align: (@theme.title_page_disclaimer_align || @theme.title_page_align || :left).to_sym,
        margin: 0,
        normalize: false
    end
  end 
end

There's also an example of how to insert a license/copyright page. See https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#license-page

gxurma commented 8 months ago

Hi Dan, Thanks, for pointing me there. Is there any plan in future to make a similar converter for doing asciidoctor to docx conversion directly? Currently I am doing it with pandoc docbook middleware and that somehow works but is not as good as this pdf generating tool. Unfortunately many companies still use docx and engineers hate writing in MS word, but their colleagues need the possibility to edit a document further.

best regards,

Martin enGYneer.at November 30, 2023 10:08 AM, "Dan Allen" @. @*.**@*.***>)> wrote: We're not going to add an element to the title page to support a one-off use case. However, you can accomplish this using an extended converter. In fact, you can find an example of this exact customization on the use cases page. See https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#custom-title-page (https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#custom-title-page)

It would look something like this:

class PDFConverterCustomTitlePage < (Asciidoctor::Converter.for 'pdf') register_for 'pdf' def ink_title_page doc super @y = page_height * 0.2 theme_font :title_page_disclaimer do layout_prose (doc.attr 'disclaimer'), align: ***@***.***_page_disclaimer_align || @theme.title_page_align || :left).to_sym, margin: 0, normalize: false end end end

There's also an example of how to insert a license/copyright page. See https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#license-page (https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#license-page)

—

Reply to this email directly, view it on GitHub (https://github.com/asciidoctor/asciidoctor-pdf/pull/2466#issuecomment-1833363969), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAPPRDGK4AL4RXTO6QE2UY3YHBEJLAVCNFSM6AAAAAA77UH32KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGM3DGOJWHE). You are receiving this because you authored the thread.Message ID: @.***>

mojavelinux commented 8 months ago

Is there any plan in future to make a similar converter for doing asciidoctor to docx conversion directly?

I encourage you to ask this question in the project chat at https://chat.asciidoctor.org. There are always a lot of people around willing to provide insight and pointers.

You can find a list of all converters we know about on the following page: https://asciidoctor.org/docs/extensions/. There is at least one that converts to OpenDocument formats. See https://github.com/CourseOrchestra/asciidoctor-open-document (I haven't used it so I'm not sure how good it is, but certainly worth a try).