Apache FOP alternative in pure javascript - pdf

I'm looking to transform a xslfo file into pdf in pure JavaScript. Any alternative to FOP Apache (which is in Java...)?

There are no XSL FO engines in 100% javascript. There are some that provide Web service interface via REST or SOAP but have a remote formatter like http://www.cloudformatter.com/css2pdf

Related

Ktor Framework using content negotiation with framemaker

New to Kotlin and Ktor. I generated Ktor app using both Jackson Serialization and Framemaker. I allowed sample code to be included.
Using Chrome browser and accessing the endpoint returning text worked fine. The other endpoint returning html returned json instead???
I noticed that if i remove the install of the Content Negotiation plugin, html is returned correctly.
Am i correct in assuming that i cannot mix the use of the Content Negotiation plugin and endpoints that also return html?

swagger API documentation with my own yaml file

I have my API documented with Swagger. For developer convenience I would like to provide the swagger GUI on my website as well. However, my provider has not installed the php yaml extension. It implies that I can't use the GUI on my own website.
So, I would like to use a third party GUI. I know that I can use https://petstore.swagger.io/ and enter the link to my yaml file in the text box. This is also not really user friendly. I prefer to open the GUI and specify the yaml when calling the url. For the user the GUI opens with my API definition.
Any thoughts?
If for some reason you cannot host Swagger UI youself, here are some alternatives you can try:
Use SwaggerHub to host your API definition and docs.
Disclosure: I work for the company that makes SwaggerHub.
Use GitLab to host your OpenAPI YAML/JSON file. GitLab uses Swagger UI to render OpenAPI files. Example:
https://gitlab.com/gofus/gofus-api/blob/dev/swagger.yaml
Use https://petstore.swagger.io with the url query parameter to automatically load your API definition:
https://petstore.swagger.io?url=https://yoursite.com/api.yaml
For this to work, the server where your OpenAPI file is hosted must use HTTPS and support CORS.

Is it possible to specify the client library using swagger codegen?

When generating a client based on Swagger metadata, is it possible to specify or configure things somehow that the output should use some other client library?
So if it was a C# client for example, to automatically replace the HttpClient or RestSharp client (I don't recall what it is now as I have not used it in a while) with some custom library?
Yes it is possible,
The codegen uses templates and configuation java classes to generate code in different languages. If you're willing to modify these templates and classes this would be a quite simple modification.
You can find the opensource repository here Swagger-Codegen
The template files for each language can be found here:
https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/resources
Java config classes:
https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages
List of template variables:
https://github.com/swagger-api/swagger-codegen/wiki/Mustache-Template-Variables
Template are written in mustache:
https://mustache.github.io/mustache.5.html
Interesting read if you want to start from scratch:
https://github.com/swagger-api/swagger-codegen/wiki/How-to-add-a-generator-for-a-new-language-or-framework

Server-side logging of html generated by dynamic site

I'm curious about how to capture the dynamic html generated via php, aspx..., server-side, just as page requests themselves are logged.
Is this a scripting task (using python for instance), a web-server log format configuration setting (I've searched Apache's docs but could only find the usual log formatting directives) or a totally different approach?

spring file upload

Is any body know how to upload files using jupload in spring frame work.how to handle the jupload request in spring?
It shouldn't matter which client you use to do the file upload, the server-side logic should be the same.
Spring's File Upload handling is documented here.