Export SAPUI5 Network Graph as PDF - sapui5

I'm trying to export the Ui control sap.ui.commons.networkgraph.Graph as PDF.
I follow this guide to rendering an org.chart
https://sapui5.netweaver.ondemand.com/sdk/#/sample/sap.suite.ui.commons.sample.NetworkGraphOrgChart/preview
I've tried jspdf to render but what I've got looks like this
I've also tried html2pdf as this link: https://github.com/eKoopmans/html2pdf.js to render but what I've got looks like this
AFAIK, these tools use svg string to render PDF. But the svg string I tried to retrieved from network graph is not enough. It miss the svg lines.
In the other hand, sapui5's Vizframe do very well exporting to PDF, thanks to the provided ExportToSVGString method.
Any suggestions please ?
In the worst case, I would have to write a function to render these graphic to svg (like the method exportToSVGString).

Related

How to make input in HTML for Telerik

I am doing export to PDF from HTML. I want to add input fields into my HTML code, but I don't know how.
I have tried a lot of combinations, but nothing is working.
Here is example what I tried:
enter image description here
You can use RadClientExportManager to export HTML content and elements to PDF. For example, see this demo - https://demos.telerik.com/aspnet-ajax/client-export-manager/functionality/export-html-elements/defaultcs.aspx.
Another approach to export HTML to PDF is to use the Kendo Drawing API.

Html2canvas does not support svg format file. Html2canvas does not support some css3 properties, such as the transform property

My company USES the html2canvas screenshot framework, but it does not support SVG format and is not friendly to the new CSS properties, such as transform, and the shape of the ellipse can sometimes be inconsistent with the original image.
There is no new open source framework to support these requirements. There is no framework to replace the html2canvas framework with the functionality of the screenshot.
My English is not good, I use the translation, thank you
i have the same problem, but here's the think you should consider:
html2canvas is only support this CSS Property.
the developers themselves say "It's not suitable for production".
But if you still want to use it, you can try to make work around by changing the CSS before render and change it back after render.
Also for the SVG issue, you can use plugin canvg, replace the svg with the canvas that canvg provide before render.
But it's still unstable, the image sometime is off the image.
i suggest to use server side capture with phantomjs, here's the example for that:
var page = require('webpage').create();
page.open('http://github.com/', function() {
page.render('github.png');
phantom.exit();
});
it's quite fast i would say.
Hope it could help.

How can I maintain image class when using mc:edit in a MailChimp template?

I'm trying to create a MailChimp template where an image is editable using mc:edit
Here's the code:
<img class="flexibleImage" mc:edit="top_image">
This seems all good, but once I edit this image using the MailChimp editor, I lose the original class "flexibleImage" and all other class and style info related to that img element.
How can I create a template with an editable image and maintain (or add) that class?
For anyone else with the problme, this answer is based on a response from MailChimp support:
It looks like it isn't possible to keep a custom class attached to an
editable image. What you could do instead though is apply the class
to the image's containing element. So if the image is in a <div>, add
flexibleImage to the div, and then update your CSS rules to point to
.flexibleImage>img.
This happens because the image you want to edit is inside an mc:repeatable block that in turn is inside another mc:repeatable block
Even four years later this is still an issue.
The other route is to put mc:edit on the parent container, and have images managed through there, but you lose the Image uploader box, which is poor user experience.
You can go into Settings when you have uploaded a new image and put the sizes in there. Not ideal, but Mailchimp is to blame here (no such issue on Campaign Monitor templates).

Is it possible to control top & bottom page margins when using UIMarkupTextPrintFormatter?

I'm trying to use the printing stuff in iOS 4.2 to print from my iPhone app, but I'm having real trouble getting multi-page content to display nicely. As you can see in the attached screenshots of PDFs generated through the iOS printing API, UIMarkupTextPrintFormatter really likes to use a painfully small top-margin when rendering.
Additionally, it doesn't seem to try to split block-elements too nicely either ... it's tough to see in the screenshot but the page break actually occurs halfway through a table row, rather than on a border between rows.
I've tried using the CSS #page directives to specify page boundaries, however iOS Webkit doesn't seem to support these at all.
Does anyone know of any techniques, either in HTML or through the iOS SDK to make these top-margins bigger?
I really don't want to write a custom UIPrintPageRenderer class because I'm trying to give my users the ability to customize their printouts through HTML templates ... going with a custom renderer would almost certainly make this impossible (or really difficult).
Any help is much appreciated!
You're on the right track with UIPrintPageRenderer, but fortunately you don't need to write a custom subclass to do this. All you need to do is instantiate a vanilla UIPrintPageRenderer, set the headerHeight and footerHeight properties, and add your HTML formatter to the renderer using addPrintFormatter:startingAtPage:. It only takes a few extra lines of code, I have posted my method here: Print paper size and content inset

Now that I have the report viewer working in Local mode, how do I set the default render method?

I have finally gotten the ReportViewer to work in Local mode. Now I would like a report to render as a PDF or Excel spreadsheet automatically.
You use the LocalReport.Render method.
I've forgotten exact details but here is a PDF render I found