The only way I know to do this is to put the CSV in a listing block, though I wouldn't recommend it if the data is large.
I found some mentions of embedded files in the PDF/A specification discussions, but I don't know if it was accepted. Even if so, prawn / pdf-core (https://github.com/prawnpdf/pdf-core) would have to support it in order for us to make use of it in Asciidoctor PDF. (Though, there's also the possibility of adding prawn extension in Asciidoctor PDF, if someone was able to figure it out).
On Thu, Dec 14, 2017 at 1:16 AM, Jan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is it possible to generate a pdf containing attachments ? That is, embedding files into the document.
My specific case is a generated pdf based on a data set. I'd like to include the csv of the data set into the document. So they always stay together.
If you reply to this email, your message will be added to the discussion below:
Actually, the Postprocessor works on the output of convert, which is only guaranteed to be an object. In the PDF converter, this is the Prawn document object. I remember discussing this with Robert at some point, but I'm not sure if it ever got mapped in AsciidoctorJ that way.
On Thu, Dec 14, 2017 at 2:51 AM, abelsromero [via Asciidoctor :: Discussion] <[hidden email]> wrote:
org.jruby.exceptions.RaiseException: (TypeError) cannot convert instance of class org.jruby.RubyObjectVar9 to class java.lang.String
Since the ouput object received is a #<Asciidoctor::Pdf::Converter>, the only way to interact with it is via Prawn or as Robert mentioned writting a whole PDF wrapper in Java. Last options is just reivneting the wheel to me, way out of our scope.
But if instead of String it provided a Stream with the processed data, one could redirect it to any other API to manipulate it.
Btw, I am laughing at Robert's sentece:
I'm also fine to stay with the current situation as it seems that no one really had these problems yet.