I'm using Delphi Chromium Embedded 3 in a project. In this project I load a local HTML file which contain a HTML form. I would like to save whole HTML source with user-filled values.
Thanks
Related
I am working on a Rails project and I need to convert the HTML page to a PDF page but it's writing HTML as it is on a pdf page. PDF page is not showing like a webpage. How can I generate a proper PDF from an HTML file?
Prawn::Document.generate("test.pdf") do
filepath = ${filepath}"file.html"
data = File.read(filepath);
text data
end
prawn is not really an HTML to PDF generator - see https://github.com/prawnpdf/prawn#should-you-use-prawn
You'll need to use another tool, for example wicked_pdf - see https://github.com/mileszs/wicked_pdf#super-advanced-usage
In your case, to quote from the README, you'll need something like
# create a pdf file from a html file without converting it to string
# Path must be absolute path
pdf = WickedPdf.new.pdf_from_html_file('/your/absolute/path/here')
I tried to set up an Orbeon form with a tree (xf:select1 appearance="tree"). Using Orbeon Demo form builder I created a page with tree and it is working in Demo environment. The same XForms code in my local Tomcat environment (latest Orbeon CE) is not working - the tree is not rendered at all.
If I check working demo HTML, then there are some additinal JS after extension functions (after sections /*! Extension 'jquery.fancytree.wide.min.js' */, etc.) and there is minimized code line a.declareCompanion("fr|tree-select1",b); which I believe registers the component. The same form code my in local Tomcat instance does not generate this block in JS files.
In Orbeon source code is file TreeSelect1.scale which I believe is converted to JS and then included in rendered HTML JS files.
Also in tree-select1.xbl strange I comment:
NOTE: When using this component outside of Form Runner, the supporting JavaScript must be explicitly included.
after:
<xbl:script src="/xbl/orbeon/tree-select1/fancytree/jquery-ui.min.js"/>
<xbl:script src="/xbl/orbeon/tree-select1/fancytree/jquery.fancytree-all.min.js"/>
What must be done to be able to render the tree?
The JavaScript for the component is not included by default. You can work around this with this:
<xh:script
type="text/javascript"
src="/apps/fr/resources/scalajs/orbeon-form-runner.js"/>
And then, on your main XForms model, put the xxf:assets.baseline.excludes attribute like this:
<xf:model
xxf:assets.baseline.excludes="/ops/javascript/scalajs/orbeon-xforms.js">
Regarding your other question about which JavaScript files are under xbl vs. not: some JavaScript files are written by hand, and are available as separate assets.
But code for other components like the tree is written in Scala and compiled with Scala.js. The resulting JavaScript for all such code is optimized and available in orbeon-xforms.js, orbeon-form-runner.js, and orbeon-form-builder.js depending on the environment. Only one of those 3 files must be included, hence the use of the xxf:assets.baseline.excludes property.
I'm working on an application that's built with Dart and Angular2. I'm using an external JS library that takes a simple HTML template (not an Angular template) in the form of a string. Right now I'm just storing the template inline in the Dart file, but that's a little messy. Is there a way I could put the template in a separate file?
You can create a file with the content like
const String someString = '''
here goes the template content
''';
and then import that file and pass someString around.
You can also safe the template content in a non-Dart file and request it from the server.
There is also the https://pub.dartlang.org/packages/resource package to load resource files.
I added a div to my haml file:
%section.splunk
.splunk_results Loading splunk data...
that will later be populated by an ajax call. However, it isn't showing up in my html file, even when I restart rails and navigate to that page. My research showed that it should auto-compile when I load the page -- why isn't this so?
EDIT:
The haml file is located at myAppName/client/order_details.haml. The HTML that it should be presumably compiling to is in myAppName/public/templates/order_details.html.
HAML files get interpreted as HTML files using the asset pipeline, which requires that your file be in app/assets.
Additionally, the controller action specifies the file that will be rendered. Take a look at your Rails logs to see what file the action is actually rendering.
How to display a HTML file from my system in iframe using rails?
I will explain my issue...
I have a view file that has an iframe which calls an action through <iframe src="controller/action?param=somevalue"></iframe> and the action renders a HTML file based on the params.
The HTML file called has reference to stylesheets and javascripts in the format <script type="text/javascript" src="../common/About.js"></script>
When viewed in browser the HTML file displays correctly with the styles and javascript but when viewed in the application the styling and scripts are not working from the external file. On viewing the source code for the external files i get "Unknown action" error.
What is that i am doing wrong in this?
(reacting to yr last comment): you need to specify css and js files in the iframed html page separately. html in an iframe is rendered completely independent from the surrounding page.
This is not a rails-related question imho.
I found the mistake I made. Its because of routes being not defined properly. When I give relative urls in the html file, the rails views assumes the full path to be some thing like src="controller/common/About.js". As there is no action defined by the name common I was getting the Unknown action error. I have redefined my routes and its working fine now.