It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I use the API's 'writer' object to write a PDF file in a SearchRequestView plugin module? Edited

OliverS I'm New Here Jan 09, 2020

I am trying to write a plugin that exports issues from the search view to a PDF file using the SearchRequestView module.

'atlas-create-jira-plugin-module' created a class that extends AbstractSearchRequestView in which there is only one method that needs to be implemented:

public abstract void writeSearchResults(SearchRequest searchRequest,
                                        SearchRequestParams searchRequestParams,
                                        Writer writer)
                                 throws SearchException

I understand that I am supposed to use the 'writer' object to write what I want to show the user.

And for a similar plugin that exports to text/html content this works fine since 'writer' is supposed to handle strings.

For PDF files on the other hand, I would expect to need an OutputStream object to take my data.

And even if I wrap the 'writer' into a WriterOutputStream object from Apache Commons IO that lets me pass binary data, I only get empty pages in the resulting PDF since the data gets corrupted in the process. How should I go about this?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you