PDF Plugin Markup and Image

When using the PDF plugin is it possible to show images from the dradis database and use the markup language in the PDF content.

Currently i can display my own image using images stored in a folder within the file-system. what i would like to do is show the images i have uploaded into the dradis database.

For example:

 image "#{Engine.config.paths['app/assets'].expanded.first}/logo_small.png", position: :left 

When images are stored in dradis we get the markup urls !/project/image.jpg!.

I have found if i use image open(url) it fails is this due to the ruby open-uri lib is not authenticated when requesting the location.

You should be able to use the same approach, uploaded images are stored in the ./attachments/ folder of the app under the node ID of the node they were attached to.

1 Like

Similar to the above - I can easily reference files in the filesystem and in the database using the method above when editing the rb file directly. What I would like to know is how to reference an image in Notes areas that will then appear correctly in the PDF Export? Currently you see the !!url!!

Is there a way to do this? Images referenced in Notes,Evidence etc currently do not appear in PDF exports

Thanks

Out of the box we’re not doing any parsing of the Issue content:

You’d have to do some regexp matching (PR welcome!), here is the expression we’re using elsewhere:

/^!(.*)\/nodes\/(\d+)\/attachments\/(.*?)(\(.+\))?!$/