Play framework 1.2.4 using header footer template - pdf

How is header footer template used to render PDF in play framework?
I was trying the below code -
options.header_template = "/header.html".
No matter what path I give for the html it always gives me file not found error. Could you please suggest where possibly could I be mistaking?

It should be options.header_template = "ControllerNamedFolder/header.html".
Where the ControllerNamedFolder is under app/views.
Thanks anyway...

Related

CKEditor5 Custom Build Image Issue

Getting this image html format when using getData() in CKEditor five with custom build:
![](/api/v1/config/template/temp/file/14fcd6-577c-586f-242-0632fb50fc5/6514462c-83d1-4fad-9239-cea69ac19097.png)
Would expect getting something like:
<figure><image url="/api/v1/config/template/temp/file/14fcd6-577c-586f-242-0632fb50fc5/6514462c-83d1-4fad-9239-cea69ac19097.png"/><figure>
Any help would greatly appreciated.
I resolved this by removing Markdown plugin in my custom build.
Got the idea here: https://github.com/ckeditor/ckeditor5/issues/8787

download pdf file of blade instead of view in browser

I would like the browser to download file on button click of blade page. The following is used in controller and and added in provider file, but its showing in browser console but not downloading file.
use PDF;
// this controller
function sensorChartPDF(){
$pdf = PDF::loadView('sensorchartpdf');
return $pdf->download('invoice.pdf')->header('Content-Type','application/pdf');;
}
///// sensorchartpdf.blade.php this is view ///
https://canvasjs.com/javascript-charts/multi-series-spline-chart/
chart static code appened in this file
To signify to the web browser that the file should be downloaded and not displayed in line you have to specify the content-disposition header with a value of attachment.
Your question, however, does not appear to be purely a question regarding Dompdf. With Dompdf you would merely use the following:
$dompdf->stream("output.pdf", array('Attachment' => 1));
I'm providing this for anyone looking for similar issue when working with the library directly.
Since you're not using Dompdf directly but via another library so you'll need to specify exactly which library or framework you're using before somebody can provide an accurate answer.

N2CMS: Tilde path not working

I am trying to use N2CMS in an existing MVC website. The problem is that when I browse the dhasboard (http://localhost:64826/N2/), I get some of the Menu links with Tilde.
e.g. This is the ink for "templates"
http://localhost:64826/N2/~/N2/Content/Templates/Default.aspx?selected=/start/&item=2
Here is an image of the problem: http://postimg.org/image/7xaup0idz/
Any idea how to get these links working?
I had to download the source code and change the method "ToAbsolute(string applicationPath, string path)" in N2.Web.Url.cs.

How to customize cluster icon using gmaps4rails

So we're trying to change the default cluster icon using gmaps for rails.
In the wiki
it says
You can customize the pics used by the clusterer by setting the Gmaps.map.customClusterer js function in your code.
Where would we put that function? It says "In the javascript" - but where? Do we straight-up edit the code generated by gmaps4rails? How does gmaps4rails pick up the information?
To do this customization you just need to create js file. Then you can
"require" that js file in your Application.js or otherwise just directly refer in your view file. That's it you need not to do anything else. I have used it and it worked for me. If any questions do let me know.
To understand how it works you can just refer the
gmaps4rails.base.js (see #customClusterer = -> false)
gmaps4rails.googlemaps.js (method - createClusterer)
it is straight forward to understand

WinRT Sharing Source Contract both HTML and Files

It doesn't appear that I can provide both HTML content and file content in the DataRequestedEvent handler.
If I provide HTML content (via args.Request.Data.SetHtmlFormat(xxx)) and file (via args.Request.Data.SetStorageItems(xxx)) the Share charm says "There's nothing to share".
Anyone got any ideas or is this by design?
var htmlExample = "<p>Here is our store logo: <img src='images/logo.png'>.</p>";
var htmlFormat = Windows.ApplicationModel.DataTransfer.HtmlFormatHelper.createHtmlFormat(htmlExample);
request.data.setHtmlFormat(htmlFormat);
full exemple here http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.datatransfer.datapackage.sethtmlformat
If time for generating the content is more that 200ms share charm says "There's nothing to share".
You can avoid this problem with DataProvider.
args.Request.Data.SetDataProvider(StandardDataFormats.Html,
new DataProviderHandler(this.OnDeferredHTMLRequestedHandler));
args.request.Data.SetDataProvider(StandardDataFormats.StorageItems,
new DataProviderHandler(this.OnDeferredStorageItemsRequestedHandler));
You can find more information here:
How to support pull operations (XAML)