How to write content into pdf? Google Cloud Storage Service

0 views
Skip to first unread message

Rob Curtis via StackOverflow

unread,
Feb 22, 2014, 3:29:23 AM2/22/14
to google-appengin...@googlegroups.com

It doesn't look like you are creating a pdf formatted file (you're just making a file with the extension pdf). You need to use a library like itext to create the pdf file and then write it to cloudstorage.

e.g using itext to write to outputstream src:

   Document document = new Document();
   PdfWriter.getInstance(document, response.getOutputStream());
   document.open();
   document.add(new Paragraph("This is a paragraph"));
   document.close();

You'd need to modify the above code to write to gcs (instead of response outputstream).



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/21916156/how-to-write-content-into-pdf-google-cloud-storage-service/21951746#21951746
Reply all
Reply to author
Forward
0 new messages