C++ Library to Convert HTML to PDF? [closed] - c++

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 looking for a C/C++ library to convert HTML (Actually XHTML + CSS) documents to PDF.
It is for commercial use and source would be nice but not essential.
Anybody have any recommendations or experience doing this?
UPDATE: To clarify, I am targeting the Windows platform only. I am developing with Borland C++ Builder 2006, but the library does not have to be a VCL component.
Many thanks in advance.
Steve.

To do that I have successfully used wkhtmltopdf.
Uses webkit and can be called from command line or as a static library. It's great and simply to use.
wkhtmltopdf website
OpensSource (LGPL) and free!
Hope it can help

Wouuld CLI applications do? If memory fails me not, GNU Ghostscript had utilities html2ps and ps2pdf. Source should be available too.

This is probably overkill, but WebKit for rendering, with Cairo for the backend could do it. WebKit is a pretty big library, though.
If you are looking for something pre-made, I found wkhtmltopdf after some quick searching. It uses WebKit and Qt for rendering, which is and even larger combination of libraries.

Just to bump this, I have evaluated both VisPDF and PDFDoc Scout and will probably go with PDFDoc Scout as it can format HTML input.
Thanks for everybody else's input.

I tried HotPDF library, it is easy to use and good enough.

CutePDF is a free PDF writer that works as a virtual printer. I guess you could use this in conjunction with anything that could render your HTML.

Have a look at PrinceXML.
It's definately the best HTML/CSS to PDF converter out there, although it's not free (But hey, your programming is not free either, so if it saves you 10 hours of work, you're home free.)
Oh yeah, did i mention that this is the first (and probably only) HTML2PDF solution that does full ACID2!?!?!
http://princexml.com/samples/

Related

Extracting page dimensions from a PDF with a C++ program [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?
I looked at the answers to this question, but they mostly relate to .Net.
LibHaru
Haru is a free, cross platform,
open-sourced software library for
generating PDF written in ANSI-C. It
can work as both a static-library (.a,
.lib) and a shared-library (.so,
.dll).
Didn't try it myself, but maybe it can help you
I worked on a project that required a pdf report. After searching for online I found the PoDoFo library. Seemed very robust. I did not need all the features, so I created a wrapper to abstract away some of the complexity. Wasn't too difficult. You can find the library here:
http://podofo.sourceforge.net/
Enjoy!
If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's free online PDF reference.
jagpdf seems to be one of them. It is written in C++ but provides a C API.
It depends a bit on your needs. Some toolkits are better at drawing, others are better for writing text. Cairo has a pretty good for drawing (it support a wide range of screen and file types, including pdf), but it may not be ideal for good typography.
PDF Hummus.
see for http://pdfhummus.com/ - contains all required features for manipulation with PDF files except rendering.
LibHaru seems to be used by many.
A non-open source approach is: PDF Creator Pilot which provides more language options including C++, C#, Delphi, ASP, ASP.NET, VB, VB.NET, VBScript, PHP and Python
muPdf library looks very promising: http://mupdf.com/
There is also an open source viewer: http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html
Try wkhtmltopdf
Software features
Cross platform.
Open source.
Convert any web pages into PDF documents using webkit.
You can add headers and footers.
TOC generation.
Batch mode conversions.
Can run on Linux server with an XServer (the X11 client libs must be installed).
Can be directly used by PHP or Python via bindings to libwkhtmltox.
http://wxcode.sourceforge.net/docs/wxpdfdoc/
Works with the wxWidgets library.

Using Google Chromium's Views Project as an Application Framework in C++ [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
I have had contact with Google Chromium Code and that’s terrific for building applications with. The problem now lies that no-one has tried to use it outside Google Chromium Project. What I have in mind is to develop an open source project which may be used for this purpose. The fundamental goals would be:
Guarantee Linux-Windows support for the same code.
Take advantage of all resources available like thread control, stats, unit test…
Make it clearer how to use Skia for graphic effects and customizations.
Present a useful application doing the most of this.
Integrate C++ and JavaScript code using V8
Use Webkit for rendering html content
There’s a chance of it get off the paper. What do YOU think?
Claudio M. Souza Junior
Developer.
see https://github.com/lianliuwei/chromium_base
I create it for the same reason like you.
chromium is great project. It's code could be useful to using in other project. but It need time to extract it. I see one project to extract the ui part, but it change too many for noreason for example it change the .cc to .cpp. my project extract the base, ui, view part for the origin project, rm the ICU (it's so big) and gurl(you can add it quick) keep the gyp, gclient, grit-i18n, gtest, gmock... change the code little. and keep the extract history. I add a new type of messageloop for using it in the MFC(for company project :( ) now it can only work on Windows but it's no so hard to make it work on linux.(google do it all)
for use the browser in you project you can see the http://code.google.com/p/chromium/ for help.
It's great this project help you a litte. I at first think it's a no one care project.
I'm assuming you have looked at the extensively documented and developed QtWebkit and know why you don't want to use that?
I'm sure it will be easier to use V8 in a QtWebkit application than to somehow tear out Chromium's "View project".
Qt has the bonus that as long as you operate within the framework, everything will work on a lot of different platforms (more than Chomium now supports I think).

Funding for MathML rendering library [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 have an unfinished MathML rendering library written in C++. I ceased development a few months ago due to lack of time. The library [still] uses the TrueType version (unsupported) of the STIX fonts beta [version 1.0 of the STIX fonts (OpenType Postscript format) has since been released].
Development of this kind of library is a HUGE undertaking and, in fact, requires a number of programmers/developers. In my case, I am doing it alone, and here's my question:
Does anyone of you know of any foundations/philanthropists who may be interested to fund my project in return for open sourcing the code?
The funding will serve as an incentive for me to finish the library - perhaps by taking a sabbatical :p - and, of course, as 'payment' for the intellectual property involved.
I've searched the web, contacted some [e.g., foundations, VCs, angels, etc.], but I either did not get a response (from VCs and angels) or was rejected (one reason is geography since these foundations support only US-based projects).
As an aside, when I search the web for MathML, the results are often outdated. I guess there's not much activity concerning MathML. Yet, I believe this library will be very useful not only to developers but also to anyone who uses math, especially students and teachers. It is useful for e-learning, can be used with desktop apps and web servers (Windows), makes it easy to insert images of formulas in PowerPoint documents, etc.
Any suggestions are most welcome. Thank you.
EDITS: I have finished this library finally without funding, although I don't rule out seeking one.
You can find my new site below with lots of sample formulas; click on the download link to download the SDK.
http://reformath.webnode.com/ (preferred for statistical reason)
http://reformath.weebly.com/ (please use the above link instead)
DON'T forget to provide some feedback - or donations. Thanks!!!!!
Since we've already got open source MathML (Firefox has had it for years) that mean you'd have to do something better than the existing OSS solutions. And at that point, why not work on an existing open source project?
So that leaves commercial apps that may want a closed library for MathML rendering. I would go after companies like the makers of MathCad, Matlab, or any other engineering software that may want to display equations neatly. You should have something that already works for some subset of the things you/they will want it to do. You should also turn yourself into a company before going to those places so they take you seriously and you can license it to multiple customers. Otherwise the most you're likely to get is a job offer where they'd like you to hand over what you've got (for free if they can get you to) and then work on it as an employee - which may be all you want if you love it and hate your day job ;-)
You should probably ask on www-math list, also if you ask there, we can list your application in the software implementations page
http://www.w3.org/Math/Software/

how to write a text editor in c++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I learned c++ on and off for several times but never write a real apps using it .
long time I've been thinking that writing a text editor will be something very interesting , now I am looking for a simple but decent text editor written in c or c++ from which I can get inspiration and learn how to write a text editor by myself.
Could you guys recommend a "simple but decent" text editor written in c or c++ to me ?
You might want to look at Zile or nvi. Both are fairly simple; Zile is Emacs-like, and nvi is the Berkeley vi. Another to look at would be Nano, a simple text editor that is designed to be easy for new users. I don't know how clean the code is on any of these, though.
I would also recommend reading The Craft of Text Editing: Emacs for the Modern World. This book surveys many of the specific problems that have to be dealt with in writing a text editor along with approaches, strategies, and algorithms for solving them. Its content should be relevant and useful even if your editor isn't going to look much like Emacs at all.
Well what you want to see sounds more like a tutorial than an actual application (I think applications like Notepad++ will be a lot to dive into in the beginning). Since you don't mention any environment you want to program in, you could check out the QT Text Editor Demo. QT is a cross platform GUI Toolkit so you are not bound to a specific operating system but probably harder to setup then a Visual Studio environment in Windows.
For Windows only you might want to think about digging more into the .NET platform (e.g. C#) as suggested in this question. It doesn't help learning C++ but it makes GUI development a hell of a lot easier.
Get the vi.
There is a big lack of true editors like vi/vim ;)
I mean there is a plenty of editors like notepad/notepad++,
but few editors which have separate command/control mode.
So You could look at the vi sources to inspire yourself and introduce something revolutionary.
Notepad++ is an excellent open source editor written in C++.
Notepad++ for some definitions of "simple".
You may also check out Scintilla editing component.
JuffEd. It is written in C++, cross platform due to usage of Qt and QScintilla. Notepad++ uses also Scintilla text editor component, but its limited only to Windows platform.
What sort of text editor would you like to make?
First question is will this be GUI or Console based?
GUI based, do you want to make something like Notepad? And on what platform? If it's MS Windows based, might I recommend picking up on MFC?
If it's text based, there are many open source solutions you can get into. My recommendation is to look at the simplest of editors like ed or something.
loot to the QT this is cross platform,HAVE RICHTEXT COMPONENT(widget).Writing first app in QT will give you actual knowledge.I recommend to learn QT by book

Open source PDF library for C/C++ application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?
I looked at the answers to this question, but they mostly relate to .Net.
LibHaru
Haru is a free, cross platform,
open-sourced software library for
generating PDF written in ANSI-C. It
can work as both a static-library (.a,
.lib) and a shared-library (.so,
.dll).
Didn't try it myself, but maybe it can help you
I worked on a project that required a pdf report. After searching for online I found the PoDoFo library. Seemed very robust. I did not need all the features, so I created a wrapper to abstract away some of the complexity. Wasn't too difficult. You can find the library here:
http://podofo.sourceforge.net/
Enjoy!
If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's free online PDF reference.
jagpdf seems to be one of them. It is written in C++ but provides a C API.
It depends a bit on your needs. Some toolkits are better at drawing, others are better for writing text. Cairo has a pretty good for drawing (it support a wide range of screen and file types, including pdf), but it may not be ideal for good typography.
PDF Hummus.
see for http://pdfhummus.com/ - contains all required features for manipulation with PDF files except rendering.
LibHaru seems to be used by many.
A non-open source approach is: PDF Creator Pilot which provides more language options including C++, C#, Delphi, ASP, ASP.NET, VB, VB.NET, VBScript, PHP and Python
muPdf library looks very promising: http://mupdf.com/
There is also an open source viewer: http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html
Try wkhtmltopdf
Software features
Cross platform.
Open source.
Convert any web pages into PDF documents using webkit.
You can add headers and footers.
TOC generation.
Batch mode conversions.
Can run on Linux server with an XServer (the X11 client libs must be installed).
Can be directly used by PHP or Python via bindings to libwkhtmltox.
http://wxcode.sourceforge.net/docs/wxpdfdoc/
Works with the wxWidgets library.