How to use html for desktop publishing? [closed] - html

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 5 years ago.
Improve this question
Not considering ad-hoc programs (like Adobe Indesign, the open source Scribus or word processors), it seems to me that Latex is the only markup language used for document preparation able to generate beautiful PDF documents.
I thought that HTML + CSS would make a terrific combination for the purpose. HTML can be easily generated from a mid-layer format (like markdown), a bit of programming based on classes can generate indexes and notes (and so on) and CSS can really style a page with ease. Preparing a document would turn out to be way easier than using Latex that is incredibly powerful but making something "out of the standard" is really hard.
The hard part would be getting the PDF. While there are a number of programs (also free)
to get a PDF out of HTML, I can't see how to retain the concept of "page". One would write the document as a single, long HTML page and let the program split it into pages, apply footnotes, headers, page numbers...
Is there already such a program? Has anyone any idea on how to implement it? Thanks.

Summary: Prince is the best option if you're serious about a high quality HTML-to-PDF pipeline. If you don't want to pay for Prince, you will probably need to compromise on either document quality or your choice of pipeline.
There is an excellent article on A List Apart about this. They used Prince and CSS2 paged media (as suggested by widyakumara) to produce pages with correctly-formatted numbers and the like. Prince is free for noncommercial use; commercial use licenses start at $3800 per server, which isn't so expensive when you consider how damn awesome Prince is.
A few cheaper alternatives were suggested in an earlier Stack Overflow question about converting HTML/CSS3 with generated content/paged media into PDF. I've tried a few of those, and I have to conclude that Prince is the only tool I've seen that can produce a paged PDF using features like generated page numbers from HTML and CSS. Prince also supports many print-specific features like footnotes.
That said, I'd suggest that this is a solution in search of a problem. HTML and CSS are proably not the best choice for documents that are intended to finish up as "beautiful PDF documents." LaTeX is not just a markup language; it is a mature, intelligent typesetting system whose goal is to produce attractive printed documents. In comparison, HTML and CSS are plainly not the best tools for the job.

there's css print media type & paged media section

Have you considered XSL-FO? Apache FOP is free and may suit your needs.

Related

Is there a font that can't be recognised by an OCR? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to write a document that can only be read by humans. The document content can't be copied. For that purpose, I am converting its pages to pictures and adding them back to a PDF file. The main issue is that any OCR program can get back the whole written text, especially that the page is going to be clear (as opposed to a scanned book) which will increase the OCR accuracy.
So, is there a font that can't be recognized by an OCR. Otherwise, is there a technique that will make my document only readable by humans, yet unrecognised by an OCR? (for instance, adding a specific background, etc...)
Thank you in advance.
In general OCR does not recognizes text by identifying their ‘fonts’, instead they do it by analyzing the features and shapes of characters, means it looks for similarities in the figure open areas, shapes of the different texts, and letters in the file being scanned for conversion. (That’s why it can also recognizes handwritten documents which are not using any fonts for that matter).
This process of identifying text through their feature is knows as Intelligent Character Recognition
I don’t think there can be a certain answer to your question that which font to use to make it unreadable by OCR but just to make it a more harder for a general OCR try using some calligraphic fonts like this one which doesn’t follow general character features, hence hard for computers software to read (this is also the main idea behind CAPTCHA).
But again this may give a general OCR a hard time but still it’s not 100% successful solution, plus it will also make it really hard for any human to read.
Take a look at CAPTCHA technology, it shares your aims so should have already found solutions/pitfalls to your difficulties.
There is no real solution to what you want. It is a typical example of trying to hold back whilst trying to publish at the same time. This makes little sense.
There are some special fonts not recognized by out-of-the-shelf OCR solutions. The user would require an additional license to get a plugin recognizing those fonts. An example is the old german "Fraktur" fonts. But it is pretty hard to read for humans too :-)
Using graphic watermark in your document can confuse OCR.
I know that some OCR engine, such as Tesseract, has trouble handling connected or cursive scripts (joining glyphs). You may want to try them and find out.

Tree with 2 parents: Build a family tree HTML/javascript as familyecho do [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 3 years ago.
Improve this question
I want to display a genealogy tree without flash. In HTML/javascript/css.
I have a big problem displaying my tree because of the:
Difficulty to display the marital link between 2 parents
the children nodes
Do you know any api which can build a family tree as www.familyecho.com does? I am gonna be crazy????
Here an example
Father --- Mother
|
|--------|------------|
Child1 Child2 Child3
Thanks
you may want to take a look at http://www.myheritage.nl as example, familiecho is pale in comparison to that. Is free for op to 500 familimembers but unfortunatly is made in Flash, so no chance of borrowing some code or libraries there.
If you just want to use HTML there is http://www.starkeffect.com/ged2html/ but is a bit oldfashioned.
There are several drawing libraries for javascript bun none that are aimed at genealogy as far as i know, anyone who comes up with one i would be gratefull.
Raphael at http://raphaeljs.com/ being the widest known vector graphics library, see http://javascript.open-libraries.com/utilities/drawing/10-best-javascript-drawing-and-canvas-libraries/ for a comparison and see this Javascript drawing library? question. Basically you will have to make a choice between vector (eg SVG) approach and rendered graphics (eg Canvas), each of them having their own advantages, libraries and followers.
See http://www.outten.org/?id=46
Based largely on the familyecho look which I also liked.
Data is dynamic from MySQL & the dragable page gfx are built locally in javascript. A bit hashed together with tables, but works in a fashion except on mobile devices.
Alex
If you are looking for an API as Familyecho. There is already an API supported by Familyecho.com You can use it, they also provide developer sample code for quick integration. Navigate to their website for more info.
Here is the link: https://www.familyecho.com/?page=api
Wes, the link was to a page that has the code embedded, not just example of output.
The data is pulled from MySQL translated into a js object (here:https://www.outten.org/data.php?id=46).
Else the javascript is self explanatory at the bottom of the document source, otherwise standard JS jQuery etc. used.
There's no licensing for this code only what has been used from others & may be used as you wish. There are many things that could be improved about it.
BTW the link has changed & been updated to:
https://www.outten.org/newTree.html?id=46
I had been looking for a JS module to do this for decades, but none do even Node.js
With regards
Xander (Alex) Lost old stack exchange login :(

Are your SASS/Less stylesheets private source code, or public like CSS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Stylesheet languages like Sass and Less allow us to organize our stylesheets like real programming source code, in more modular and manageable ways than raw CSS ever could. Using these languages is still a young art, and I'm curious to learn how other developers use them in practice.
One of the neat features about the openness of the web is that we can learn from others by peeking at their HTML and CSS. However, these new stylesheet languages allow developers to keep their stylesheet source code private and only share the compiled CSS output. The standard compiler settings will often have the stylesheet source folder outside the public webroot.
If you use a CSS preprocessor to develop a commercial (closed-source) website, would you consider the stylesheet's source language (Sass or Less) equivalent to the CSS in terms of openness, or is it proprietary source code?
On the one hand, these languages "only" give us different syntax for writing stylesheets, so their function is the same as the CSS that's already publicly visible.
On the other hand, they could be thought of as "source code" and considered proprietary, in the same way as the Ruby or PHP that drives the site is used to generate HTML.
Looking forward to your thoughts.
Looks like you and I are the only ones following the css-preprocessing tag, I just found this and wanted to share some thoughts.
For the small company I work for, we use the same homebrew CMS to manage every site, and there is a lot of magic involved in creating the css files. I don't use LESS or SASS, but a combination of cssmin and my own code. There are theme settings in the CMS that can affect it, and there are other things like url rewrites that have to read settings from php config files. The output is always there for anyone to see, but I wouldn't consider the code that generates it "open source" any more than the code that generates the html output.
Our CMS is not open source, so our policy is that when and if (hasn't happened yet) a client decides to drop us and "wants his website", we generate a static HTML version for them with absolutely no php source code. So they would get the static version of the css/js as well as static html. They are paying for a service, and not so much a product. We don't sell the CMS, we sell our services building the site and access to those same tools. I'm not sure how well this would bode if it happened, but that's our current policy.
Anyways, this might not be exactly what you meant, but I'm looking forward to hearing more on this if anyone ever finds it.

Delphi - Is there a suitable WYSIWYG HTML Editor Component for VCL/FMX app? [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 need a WYSIWYG editor Component that I can use in the Delphi application to create the body of the email in HTML.
We've used TRichView just recently to do HTML email functionality and found it quite adequate. We did evaluate WpTools and it does do exactly what we wanted however for our needs it was just too expensive especially when we always try and purchase site licences.
One thing we did find with WpTools is that it did implement a visual component or set of visual components that you could drop onto a form that implement the whole WYSIWYG UI (e.g. toolbars and such). It took a bit longer with TRichView to achieve the same thing.
Regarding conversion from/to html - TRichView can export html natively, however requires third-party libraries to import html which unfortunately (for us) are not commercially backed (i.e. community driven). So we've resorted to storing all content in RichText natively and only when sending the email do we convert it to html. WpTools has the ability to import/export to html natively.
I have been looking for this as well for several years now.
The best solution I found, until now, is WpTools from WpCubed. It's not an exact Html editor, but an advanced word processing component which offers a copy mode to and from html. I am currently working on using this component in my Sitestepper web creation software (in the StepEdit html-editor to offer wysiwyg possibility). I think that certainly for email editing this could be used (although maybe a bit pricy for what you are looking for). I know the author is working an a better exchange to and from html.
But to be honest, I don't think you will find anything if you need a Delphi component.
I used to use HtmlEdit from Purposesoft, but I think this product has got his limitations and it's not fully supported anymore. But maybe for your purpose it's ok.
I've used EmbeddedWB from bsalsa. Basically it is the same as Delphi's TWebBrowser, but you have access to more features of the IE automation object. In the browser I loaded an HTML which looks like:
<html>
<head>
<title>Edit description</title>
</head>
<body contenteditable="true">
</body>
</html>
Marking an element by IE specific attribute "contenteditable", the IE implementation let's you edit the element's inner HTML in a WYSIWYG manner. You can get the content by automation calls (check bsalsa.com to see how to read the edited content). If you get the basics it is pretty simple to create a full blown HTML editor.
Good luck!
My answer using Bsalsa Web Browser Components - very easy complete HTML editor/viewer.
delphi-how-do-i-make-a-basic-wysiwyg-html-editor-using-delphi
If using IE COM based components is not a problem then you can use this free product
http://bsalsa.com/product.html
I have just recently needed a free HTML WYSIWYG editor and I thinks this is the only thing out there. For me it works fine, but I don't need complicated elements. They can be done, but will a little more work.

Source code of books made with TeX/LaTeX to learn [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 7 years ago.
Improve this question
Some time ago, reading this entry I found a nice image and a pointer to a better book entitled "Thinking Forth". To my surprise, the LaTeX sources of the book were ready to download, with pearls like:
%% There's no bold typewriter in Computer Modern.
%% Emulate with printing several times, slightly moving
\newdimen\poormove
\poormove0.0666pt
\newcommand{\poorbf}[1]{%
\llap{\hbox to \poormove{#1\hss}}%
\raise\poormove\rlap{#1\hss}%
\lower\poormove\rlap{#1\hss}%
\rlap{\hbox to \poormove{\hss}\hbox{#1}}%
#1}
%\let\poorbf=\textbf
\renewcommand{\poorbf}[1]{{\fontencoding{OT1}\fontfamily{cmtt}\fontseries{b}\selectfont#1}}
in which it can simulate the bold stroking of a font that doesn't have it. Since reading that, I was unaware of \llap and such, but now I can use them to define boxes, etc.
So, my question is twofold:
Do you know of sites that show that relatively advanced use of TeX/LaTeX in terms of useful recipes, and
Do you know any books that offer their TeX/LaTeX source to inspect and learn (and that are worth doing so.)?
There are two comprehensive reference guides/recipe books for TeX:
TeX by Topic by Victor Eijkhout
TeX for the Impatient by Paul Abrahams, Kathryn Hargreaves, and Karl Berry
In both cases, the sources are also available.
As lindelof mentions, the TeXBook is also available, albeit in a form that prevents compilation (Knuth wished people to look at the source for inspiration but not to reproduce the book freely):
The TeXBook by Donald Knuth
On the LaTeX side of things, resources a little more scarce from the programming point of view. The best free reference that I know of is
Formatting Information by Peter Flynn
Of course there's also
The Not So Short Guide to LaTeX by Tobias Oetiker
but that doesn't cover so much programming "stuff". The LaTeX sources themselves contain some useful nuggets, but the quality of the documentation ranges from excellent to non-existent in parts; this should be available in your distribution with texdoc source2e.
Other large LaTeX packages obviously have the source to their documentation available; a notable example is the memoir class:
The memoir class by Peter Wilson (memman.tex is the documentation)
I'm sure there are many more books with their source available; these are just the first ones that come to mind that happen to also be able TeX and/or LaTeX.
Believe it or not, but the source code to the TeXbook is actually freely downloadable:
TeXbook source code package
Not that I'd recommend it (unless you've got a lot of time and caffeine to spare), but I learned a lot from just reading the latex.ltx file. I learned a lot not only about LaTeX but also of course about TeX. It's a heavy read though and I'd suggest reading a book about TeX first before diving into the latex.ltx file.
I wanted to know about how "optional" parameters actually worked and reading the latex.ltx file really helped me understand.
Another book that would definitely fit part 2 of your question is LaTeX for Complete Novices by TeX.SX member Nicola Talbot.
This later question, posted on TeX.SX, is also relevant for part 2 and worth reading.
I found this book by Allen B. Downey that looks really nice: Computational Modeling and Complexity Science.