New web to print solution [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm working on a web-shop with a personalize function. The web-shop is going to sell prints. Before customers goes to check out, they will be able to customize their product/print with just changing custom text on the designs. I know their is many different web2print solutions. I'm thinking about using Adobe's Scene7 web to print solution. It's a service and will cost money, so I rather do something more simple.
The thing is that most web2print solutions are so advanced with so many edit options. I just want to have limited rows of text to customize.
So my idea was to make the designs in html and css. With a basic background image and text on top of the background image. When the customer is done filling in the form for the text and clicks order. The web pages makes the html-css coded customised design and makes it to an image that gets mounted on high resolution printable pdf.
There is many web to pdf solutions, but the problem is that they doesn't seem to make an exact flat copy of what's shown in the design. I want this to work server side.
In my head this doesn't seem so advanced, maby i'm missing something?
I know css and html good, I can also handle javascript and some php. But i'm also open to learn new languages and programming skills to get this to work.
Thanks!

Use SVG which is the standard vector format (can be resized without loss in quality) and will look the same across implementations.

Related

Draft-js saving and displaying HTML [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm wondering if anyone came up with any tutorial / walk through for Draft-js to simply save editor state and display it as html to the user. I've been searching and trying and still unable to display html. It seems like most are just saving the editor state and reloading it into the editor instead of displaying it as html.
It seems like most go with convertFromRaw and convertToRaw, but the amount of steps included in that seems like there are quite a few steps that should be simplified, and the example here: https://draftjs.org/docs/api-reference-data-conversion.html#content seems like it's only used to place the content back in the editor later.
Maybe I'm not even looking at the right tool - I simply want an editor to save formatted text and display it. I'm not sure why the resources are so hard to find, or if I'm just looking in the wrong spots (seems like there are too many packages for Draft-js with not much documentation and examples IMO). However, I'm sure this must not be hard to accomplish.
Draftjs is concentrating on displaying rich text within an editor. However, if you want to display the corresponding HTML you have to use an external package called draftjs-export-html.
import {stateToHTML} from 'draft-js-export-html';
you can get the html using let html = stateToHTML(editorState.getCurrentContent(), options); this will do the basic formatting of styles like bold, italic etc. You can also pass your own styling preferences of your draftjs entites using the option parameter.
https://www.npmjs.com/package/draft-js-export-html

Bokeh plots are very difficult to load [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am trying to show a Bokeh plot in Firefox. There are quite many sub-graphs (approximately 200), each showing 1-4 objects.
I am receiving in Firefox:
"A webpage is slowing down your browser."
Some notes:
After rebooting, it works fine for a couple of times.
I am behind a corporate proxy. I ask myself if it may be the cause. Some JavaScript and CSS is being loaded from cnb.pydata.com.
It sounds like your Firefox version is having issues with said webpage. Although I'd say that the design of such site trying to show 200 JS driven plots seems questionable.
As far as I know, there is little that you can do besides updating Firefox, they have been busy lately improving many elements of performance, or trying another browser with better JS performance like Chrome.
If you're in a corporate network it might be many not possible for you to upgrade or install, then you have to go to you IT department looking for help.
Now, since you're generating the HTML with the graphs, perhaps would it be a better idea for you to make a "dashboard" where you show a few and then use dropdown menus or sliders to control which plots are shown at any given time. I've seen solutions using using bokeh itself to do so, or if you want eventually somethign fancier you can also use flask.

Why is Google.com's source code so messy? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm just wondering why Google.com, one of the most minimalist websites, has a so messy HTML source code.
Two main questions:
Is it a sort of obfuscation in order to keep parts of the code "secret"?
Has anyone ever tried to explain it?
Two things I can offer to help understand what's going on with google.com
While the displayed content on the page is simple, there is a lot going on in behind the scenes to understand your browsing history, cookies, etc. to serve up dynamic content such as preset search results and ads, of course. In addition, while every piece of google.com looks simple but has much more going on behind it. The search bar gets populated with a drop down of search results as you type. Apps in nav bars get loaded as you drop in. The language of the site can change instantly. All of this is quite complex.
All of this code has been minimized and files have been concatenated together to reduce page load time, making it look really messy. You're right in that google isn't interested in making the code you can see on their main page understandable. Their goal is to serve you the best possible experience. Hopefully that clears some of it up!
If you're referring to the code you see when you press "View Page Source" on Google, then yes, the code is obfuscated. There are a number of reasons people obfuscate code, but the main ones I've heard of, are for compressing the code to make for faster loading times, hiding the code so people can't read it (which is pretty obvious), and lastly, to prevent people from being able to use the website from phishing. For many websites, you can just copy/paste the source, and make a very similar looking website to do a number of malicious things.
They might be minifying the JavaScript or using their own Closure JavaScript compiler to make it smaller so the page loads faster. Obfuscation just maybe a side effect.

Dynamically reordering DIV elements [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I recently started studying html, css and javascript since I'm quite interested in being able to create my own news website and I realized that I don't really know how to accomplish the following thing :
I want my website's homepage to have 10 div blocks and every one of them to have a headline with hyperlink to the corresponding html page. However, when I add a new div, I want the bottom div block disappear so it can make room for the newest div that's gonna be on top.
To be quite honest I have no idea what I need to study to accomplish this. Here's an image depicting what I want to accomplish.
Can you throw me a brief explanation or some keywords for me to google in order to understand how to do that?
This is a bit of a tricky question without knowing precisely how you want the items (the div elements you mentioned) to be added.
If you are adding these items to the set dynamically (without reloading the entire page), then you may want to use the overflow property of the container of these items. This way, you can keep the items that were already in the set from disappearing as someone is about to visit them.
Otherwise, if you plan on only loading the latest items in your database when the page is visited, you will simply have to use the correct queries to return only the correct amount (the amount that fits in your "set") of most recent data from your database.
I should probably mention that building this website from the ground up without any help will be quite the challenge for a beginner. Especially since you will have to do all of the back-end work as well to set up your database. I'd advise seeking help from someone with experience in this area if you can, because it wouldn't be much fun to start off in the wrong direction and have to completely restart!

Code colors in Html using CSS or javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have a website and I teach Java on it.
I know html and css if it helps..
I have lectures in my site and in my lectures there are descriptions: in the description I write code sometimes so I made a class for code so everytime I type code I do and it looks good, but not perfect.
I want to make specific words to be bold and in blue or pink color for example.
Is there a way to do it? maybe with javascript?
I know I can create a new class for special words and then to do for example but this will be too much job to write this span every time that it's not worth it.
So is there a way to do it maybe with html5 or js? Thank you.
edit: I use the usefedora.com platform so it's more difficult to do it, does somebody knows how to do it on usefedora's platform?
the thing you are searching for is a codemirror. There are many codemirrors but only one of them is called codemirror.
Code Mirror
There are also solutions that don't require you to write any javascript, using web components.
Prism.js
Here is one that's insanely trivial to use
There are plenty of code to html converters which do syntax highlighting if that's what your looking for e.g.
http://tohtml.com/java/
or
http://hilite.me/
You can take this HTML and use it on your site.
You can also download a jQuery plugin. SyntaxHighlighter is very popular.
The way they work is that you copy the files to your website, and then you just put your code into a tag, and the plugin automatically beautifies your code.
I would recommend choosing one of these libraries- PrismJS, Highlight.js, or Rainbow.
Each is designed for exactly this purpose. You just put your code into the web page, inside an HTML5 code tag decorated with the language name. They will automatically format your code with the necessary markup to attach color styles to. No need for any external tools. The first two provide their own styles as well, the last assumes you'll write your own.

Categories