Render watermark in play framework 1.2.x pdf - pdf-generation

Im using Play framework 1.2.x and PDF moudle 0.9. I would like to render watermark in my generated PDF. I got some information through iText while google it, but not for Play framework. Though Play framework uses iText in lower layers I didn't get any information to configure it. Please help me
UPDATE: Im able to achieve this via specifying background image for the body tag
<body style="background-image:url(/resources/img/draft_watermark.jpg)">

Im able to achieve this via specifying background image for the body tag
<body style="background-image:url(/resources/img/draft_watermark.jpg)">

Related

Java PDF Generation iText Alternative

I am brand new to pdf generation or rendering. I am working on a application to replace iText and create kind of a RESTful endpoints using any Java related PDF APIs.
The library should be able to convert images and.., others to PDF.
Read/fill the data from PDF programmatically and also merge.
Also, if we can host it ourselves that would be the best choice.
Could you please provide some insight into this?
Not exactly a "Java related PDF API" but since you want to go REST anyway:
We use a headless Chrome in a docker container for generating PDFs. A good starting point is hc-pdf-server. We use it as an internal service using REST.
Note that this way, documents need to be designed using HTML and CSS. Also, you need to use a template engine in order to insert contents into your documents. We use Mustache. It is simple and does the job.

how to solve the kwidget not defined in kaltura

I have modified my modified my html5 library to point my kaltura server. Now I am able to play videos as static html webpage. but I tried in my project which is developed using php, it doesn't play the videos in even PC's too.
It says kwidget is not defined.
I used the kWidget embed code. But it s not happened in auto embed or flash embed.
But I read that kwidget is good to reduce the page load timings
If you are using any MVC, you need to add the mwEmbedLoader script in the service or controller's head. I think you used the kwidget code in view sector and not add your script in controller page. you need to add your script in all the pages wherever the player function calls as below.
You can add that in couple of ways.
<script src="http://youkalturaserver.example.com/p/partnerId/sp/partnerId+00/embedIframeJs/uiconf_id/11170264/partner_id/partnerId"></script>
<script type="text/javascript" src="http://youkalturaserver.example.com/html5/html5lib/v2.69.7/mwEmbedLoader.php"></script>
replace v2.6.7 with current release version:
https://github.com/kaltura/mwEmbed/releases
It will solve this error

Google Apps Script fade in

Is there a way to make an image slide show using only google apps script ui services.I have created a gallery of image but doesnt have any transition animation. I cant find any example using any effect animation (fade in fadeout). I cant also find any timed events examples. Thanks.
Using JQuery, this will not be possible using the UiApp. I believe Caja rejects CSS3, so therefore you wouldn't be able to set it as an attribute either.
The only thing I can suggest is utilizing the HTML Service which would allow the use of JQuery - be sure to use Google's hosted JQuery as it will run faster for you.
Hope this helps,
Cheers.

play framework 1.x to render rich text

I am using Play framework 1.x and in one case, we are saving rich text data (I am currently using using ckeditor-JS on client side but am open to other suggestions e.g. markdown etc). The data gets saved in the DB correctly i.e. with the HTML tags (unless I am misinterpreting how it ought to be saved). I need to be able to render this content as HTML in my view - should I be looking to use the same library for handling the conversion or is there something in play framework (1.x) itself that I could possibly use. Hope I explained the question properly and thanks in advance to any useful suggestions.

Converting HTML to PDF with images for a secure site

Below is the HTML that I want to convert to a PDF.
Hi Hello how are you?
<p><img height="151" width="154" src="http://qa.openoffice.org/branding/images/bannerlogo.png" alt=""></p>
<p><img height="151" width="154" src="https://www.nprocure.com/nprocure_images/banner.jpg" alt=""></p>
I tried JODConverter, iText and some tools in the market to do so.
But the image for which the source is https doesnt get converted. The rest of the HTML does get converted.
Any clues on how we can embed the secure images in PDF?
I am looking for some java code snippets to do so.
Regards,
Tina Agrawal
The www.nprocure.com security certificate is not trusted. That could be the reason why the image is not converted.
Check out the Pdfcrowd HTML to PDF API for java: http://pdfcrowd.com/web-html-to-pdf-java/
You can test your HTML code online at pdfcrowd.com/#convert_by_input. The created PDF looks ok.
It sounds like the problem is the http client underneath the pdf libraries that you are using.
I would start off by abstracting the html resolution into it's own piece with something stand alone such as the apache http client. Once you get that going, you can hopefully plug in what you get from it into a PDF renderer and hopefully get what you need.
Good luck!

Resources