Best API/ GUI For Working With Pdfs?

Does anyone have any recommendations for a relatively easy to work with API platform/ GUI for working with pdf files?

I've just finished https://www.learncpp.com/ & I'm now looking at learning API & GUI tutorials. I was planning on using Windows API & Microsoft Direct 2D because this setup was recommended to me by someone far more knowledgeable than myself. This would be fantastic because it would be as fast as can be & I am aiming for deployment on Windows 64-bit architecture. BUT - I'm concerned with how I will open pdf files with this setup.
From my point of view my programme will be concerned with displaying single-line pixels (if possible). It's primary focus is not towards bitmap graphics such as gaming. My primary focus is 2D construction drawing pdfs, being able to open them & work with them easily/ import them easily & being able to print these files.

Obviously not greatly experienced but just trying to make sure I start out on a path that will get me there. I think wx widgets provides a decent platform for working with pdfs, but I'd be keener to work with Windows directly; as it will be better performance. It'll be a bit more involved I think, but saying that maybe it won't be much harder, as wxwidgets would have lots of wrappers & a bit bloated, compared to working with a native framework.
https://www.adobe.com/devnet/pdf/library.html perhaps?
I have not tried to code against pdfs in so long you could do a lot just by grabbing it as if postscript back then
Last edited on
Google "c pdf library". Example result: https://github.com/libharu/libharu

Just a heads-up: this is really not a project for a beginner.

I think wx widgets provides a decent platform for working with pdfs, but I'd be keener to work with Windows directly; as it will be better performance.
Your problem is already complex enough. I'd suggest choosing the path of least resistance and choosing whatever technology is easiest to work with. Performance should be your last concern at this stage. Hell, I'd suggest skipping C++ and doing everything in C# and WinForms.
@helios,
I agree about C#, but why the old WinForm instead of the modern WPF.
Thanks for all of your input. Sorry for the late response; family visit. Helios I googled this prior to posting, but I'm trying to get some early input from experienced hands; saving me time e.g. saving me a month not learning the wrong language lol.

C#

To clarify, I only need to get the pdf into GUI to load & display. I've'll then be drawing ontop of the pdf, accessing it's image.
I'm really worried now. I've spent a month lealrning C++ because I'm fascinated with how a computer works. But I agree that I should be choosing the path with the least resistance. I have around 4 weeks working full-time to get this done. Should I now start learning C# for the GUI/ whole application?
I know vba, html & css; I'm no expert at all, but not a complete beginner. I have most of the logic gates written in flow-charts for my control-flow. But a complete beginner in GUI's & the C++ language.
I agree about C#, but why the old WinForm instead of the modern WPF.
I couldn't say which one is better or more appropriate for a given task. WinForms is what I use because meets my needs.

I have most of the logic gates written in flow-charts for my control-flow.
Can I see that? I'm interested in what you think "most of the logic gates" means.


Let's step back a bit. A PDF contains a mixture of text, bitmaps, and vector images. Let's start with the simplest of those. Have you ever written a program that loads a bitmap (e.g. a JPEG), displays it, and allows you to draw on top of it? A rudimentary bitmap editor, in other words.
Thanks Helios, do you think I should ditch a month's worth of learning full-time to delve into C# now? I have only 4 weeks left of being able to study full-time.

You are completely correct, I have never displayed anything via GUI, vector images, bitmaps etc... & am very much looking forward to learning this.

Bear in mind I have great interest in how a computer works & have greatly enjoyed learning how it works with C++. But granted I do want the shortest route to get this programme up & running.
I know I probably won't get it done in 4 weeks, but I should get on my way with the GUI at least.
It all boils down to if it will be quicker learning C# from scratch for the GUI?
I can absolutely guarantee you will not finish this in four weeks even if you don't sleep or eat at all, so there's no point in trying to optimize your time. Start from the idea that just learning enough to be able to complete this project will take you many months.
If you still insist on trying to complete this in four weeks then I'm afraid I can offer no advice. I have no idea how a one-month-old programmer could finish a program to load, display, and manipulate PDFs in four weeks.

So, with that out of the way, what is it you want to do, ultimately? Do you want to write this program to learn C++? Is it to solve a real problem you have? Do you want to learn how to work with GUIs or with graphics? Do you want to learn how PDFs work? If you tell me what you want perhaps I can offer alternative projects that you can complete in four weeks and that will take you closer to your ultimate goal.
I think C# is much easier to learn than C++ so you can get quite a lot done in 4 weeks.
This site has a lot about dealing with graphics and GUIs, so when you have learned the basics have a look there. http://www.csharphelper.com/howto_index.html

Another great source is codeproject.com
Thank you for your candid response. To clarify my intention - I'm not trying to manipulate pdfs, I'm only trying to display a pdf really, I'm not trying to create a pdf editor.

1 - My programme which I want to be able to do asap is for quantity-surveying purposes. The drawing ontop of a pdf can be done via my own code & is only to display lines being drawn; so it's not complicated really; it's only a question of storing an array with point values of x, y & z. All I'm doing is drawing basic lines ontop of the pdf. The maths behind it I have done in excel already & typing these up in C++ will be under a week's work. The tricky thing is the GUI.

2 - I'm very interested in how computers work, & learning C++ is the best language to do that, but ultimately this goal will greatly help me in my career already (construction estimating). I have a deep passion for how computers work & it's consumed me. But the goal here is to get this program written asap. I feel a months work is a shame to throw down the drain, but many people are saying C# is better suited for GUI's. I can see that C++ is a nightmare with this, but I do find it greatly interesting, but the goal is the progam first; asap.
C++ just takes a bit more to get to the fancy stuff like gui etc. It can do everything you want, but it will take longer to learn it, is all, and more effort. A lot of languages make doing the fancy stuff easy up front, but lack the depth to do other things well, and have worse performance, or whatever tradeoffs vs c++. C# is a fork of java, which is a child of C++, so much of what you know will transfer between them, with some differences as well. They share a root syntax, in other words, so you can salvage some of your effort if you choose to swap out. Or you can keep going, just be aware that it will be a bit harder.
Last edited on
Are pdf madatory?
Wouldn't it be possible to convert the pdf to image first and display and draw the image only?
Thanks jonnin & Thomas1965.

Jonnin
I know jonnin, C++ is the most respected language & can do whatever you want. Saying that googling displaying a pdf in C# yields many results, opposed to C++ yields very few results & not much material out there on this. I'd rather carry on with C++ as the language is a lot more interesting & powerful but wonder how much longer it'll take compared to C#.

Thomas1965
I don't really need to export as a pdf. I'll always receive them as pdf's; so converting to an image would be an option then working in that format to do what I need to do in the GUI. Again I can't see much on google regarding loading in pdf files.
Option for c# are itext https://itextpdf.com/en
Last edited on
Topic archived. No new replies allowed.