Ganesh Ranganathan wrote in post #1141109:
> On Thu, Mar 27, 2014 at 1:04 AM, masta Blasta <
li...@ruby-forum.com>
> wrote:
>
>> I'm pretty certain though that there is nothing out there that will
>> parse an adobe illustrator file for you.
>>
>
> Thanks masta. Is there any intermediate file format that both Prawn and
> Illustrator/Indesign can talk with. The person designing the report only
> knows these two tools which
No. It just can't work that way.
Prawn uses its own syntax (DSL) to create a PDF. It is ruby code that
has to be written from scratch.
Something like wicked_pdf, turns an HTML document into PDF. That means
you need your document to be an ERB template that you can then use the
plugin on to get a PDF.
There is no way to automate the process in the way that you want - Read
.ai, parse .ai, find my fields, plug in these values into those fields,
spit out a PDF. That is such a hugely monumental process, that I don't
even think any proprietary Adobe software does it.
Rails can do a lot of things, but not that.
You need to MANUALLY turn your illustrator file into a template.pdf.erb
file (which is the same as a .html.erb file). You will need styles,
proper HTML, the whole works.
Then you make a controller action to accept the pdf mime type
respond_to do |format|
format.pdf {}
then follow the instructions on the wicked_pdf gem for all the other
configurations. It's not a simple process because of the wkhtmltopdf
binary.