iTextSharp - where are PdfDocument, PdfCanvas, ...? - vb.net

I'm generating PDF documents using iText(Sharp).
I'm developing the app using Visual Studio 2017.
I've added iTestSharp using NuGet and I've experimented with both VB and C#
All is fine for the 'high-level' stuff (chapter 1 from the jumpstart tutorial). Now I want to go more low-level using 'page', 'canvas' and 'low-level' drawing commands : chapter 2 from the jumpstart tutorial
http://developers.itextpdf.com/content/itext-7-jump-start-tutorial/chapter-2-adding-low-level-content
My problem is that I can't access the classes PdfDocument, PdfCanvas, etc. these classes are not available..
Also I can't create a New PdfWriter object (New operator is not implemented)
What's wrong ?
am I missing some Imports / using libraries ? (I currently include
iTextSharp.text and iTextSharp.text.pdf)
has this someting to do with iText V5 - > V7 and is the tutorial maybe a bit out of date ?
are these classes only available in the Java libraries, and not in the .NET port ?
Does anyone have an example of drawing stuff on a canvas using VB.NET - this would be very helpful!
Thanks.

To clarify further:
iText 5 .NET is nicknamed iTextSharp because of historical reasons that are beyond the scope of a Stack Overflow question.
iText 7 .NET doesn't have a nickname because we (iText Software) want to emphasize that it is exactly the same product as iText 7 Java, just for a different platform.
The tutorial you found is not out of date, on the contrary, it's the most recent one. It's the iTextSharp you got from NuGet that is out of date.
If you read the description on NuGet.org then you will clearly see that iTextSharp is the old version: https://www.nuget.org/packages/iTextSharp
We have two currently supported versions: iText 5 and iText 7. Both
are available under AGPL and Commercial license.
iText 5 AGPL
iText 7 community: https://www.nuget.org/packages/itext7/
iText 5 is a one solution library that is complex, but well documented
to help you create your solutions.
iText 7 is a complete re-write of iText 5, allowing you to choose your
adventure with add-ons, all based on a simple, modular code structure
that is easy to use and well documented.
and
iTextSharp is the .NET port of iText 5.
If this wasn't clear enough for you (and it obviously wasn't), then I would really, really appreciate your feedback on how we can improve the description on NuGet.org.

Make sure you have the right NuGet packages on your system.
To try this out, create an empty project and include NuGet packages
iText7 by iText Software v 7.0.4
The jumpstart tutorial was written for iText7, so it make sense you'd need that specific version. iText7 is a complete re-write of iText5. So you might indeed find several classes missing if you try to run the samples against the iText5 library.

Related

Does DocToolChain support Python?

I came across docToolChain (http://doctoolchain.org/) for generating Docs. Wanted to know if this can support other programming languages such as Python, Go etc? Or will it only support Java?
yes, it does - depending on your needs :-)
When we incremented the version of docToolchain from 1.x to 2.0, the biggest feature was that the technology is now hidden behind a wrapper.
You still need java installed (v8-v14), but you don't have any code any more in your repository.
But regarding Python - it is quite likely that you want to use restructuredText as your markup language.
Until now, docToolchain focussed on AsciiDoc (based on ruby) as the markup language for your projects documentation.
There is now a feature coming up: jBake, the static site generator used by docToolchain is already able to render markdown.
But there is now also a PoC which shows that it can also render restructuredText with a little help of a small python script:
http://doctoolchain.org/multi-markup-demo/demo/asciidoc.html
PS: I am the maintainer of docToolchain, so my answer might be biased

Add acroform with pdfsharp

how can i add Acroforms (or any inputfields) with pdfsharp lib to a pdf?
For example a textbox (PdfSharp::Pdf::AcroForms::PdfTextField)
I can't find any example for this, only read/modify.
I found "page->Elements->Add(key,pdfitem)", but i cant create a Object from PdfSharp::Pdf::AcroForms::PdfTextField or the others Forms (no Constructor)
Don't know if it is still relevant (maybe it will be relevant for other users), but it is not possible to do that with PDF Sharp, unfortunately, as if it would have had that functionality as well, it would have been a really nice rounded library. The AcroFrom functionality of the library only allows targeting already existing one.
Depending on what is your project for you can use iText sharp, but it has an AGPL license which is not ideal, there are other libraries but they are quite expensive. If it is a small pdf file (under 10 pages) you can use the free tier from the SpirePDF library.
In addition, there is PDFClown library which is open source (as long as you mention that you use it somewhere), but similarly to PDFSharp, it is quite old, and even less documented than PDFSharp.
Sadly, there aren't many solutions to this issue.

Reading pdf in win 8

I need to read and edit existing pdf in win 8 app.
Editing pdf include adding text and images at any position on pdf.
Shall i go for xaml or javascript based coding.
which link should i follow that will give info for editing pdf.
Maybe this can help you : ....
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/d115b1a4-bbcd-415d-81c4-fc167bf918f6/
PDF is a beast of a file format. If you don't have lots of software development experience (which your question suggests you do not), writing a PDF editor from the ground up (especially if you have no team) can be a daunting task, even only considering the non-UI aspects of it.
Even should you implement a library that's 100% conforming to standards, you'll have to deal with all the faulty PDFs out there. Which very few readers, including the Win8 PDF reader, accomplish.
In case you're looking for a library, you should have a look at http://www.dynaforms.com/ - it can cope with most PDFs and has some editing functions and a renderer (in the professional version) as well and there's a Windows 8 compatible version of it.
If you want ready framework, you can look at Foxit Software solutions. They already have framework for Win8, but it can be expensive.

Create PDF Annotations in iOS

I've been working on a pdf viewer with support for annotations and I need to be able to save new annotations that the user has created. I've seen tons of examples on how to draw text/lines/images, but that's only flattened content, I need to create actual annotation objects
I've found no documentation or examples about it, so if anyone could point me in the right direction I would be extremely grateful
Cheers!
Edit: After several months of work we could release the v1 of this. We ended up using an open source c++ library, and went through a huge pain to make it compile for iOS. The one in charge of that isn't working in the company any more so we can't publish how we managed to do it
Well, there are several paid/free source codes which are available which includes pspdfkit, fastpdfkit etc. Find the links below:
Well maintaining, support, and features but very expensive:
http://pspdfkit.com/
Looks nice, but not maintaining/support:
http://fastpdfkit.com/
https://github.com/vfr/Reader/
Other StackOverflow Threads:
add annotation to pdf
Add an annotation on a pdf
Annotation (notes, comments) using Quartz 2d in ios
Blogs:
http://codecanyon.net/item/html-pdf-viewer-ios-xcode-project/154673
http://www.binpress.com/app/pdftouch-sdk-for-ios/859
For free/open-source app you can check at
http://poppler.freedesktop.org/
Please read the issues before using this framework, this developer is no longer maintaining and it has some serious issues.
I created an open source framework for PDF annotation in IOS in GitHub. It supports both iPhone and iPad. Please check it out here.

What do I need to build a DLL?

I'm having a number of issues, and the current one is overcoming a security exception when using iTextSharp.
This article
http://www.junlu.com/list/27/763977.html
To which I was directed following this question I posted yesterday:
Displaying a bar code with iTextSharp using Chris Love's Barcode Handler (2 part)
Seems to be what is required to overcome my problem. But I have searched and searched and cannot find a definitive and simple answer to the question "How do I compile a DLL"
So, having made the suggested modification to iTextSharp, I need to make it into a single DLL.
I have absolutely no idea how to do this, despite an hour of Googling!
I'm using Visual Web Developer 2010 Express. Which according to my searches does not have any built in capability to do this. So... how do I?!
Do I NEED to download Visual Web Developer Pro? I can surely download the free trial and use that, but going forward, I don't especially want to have to download a pay-for program to do this as it's a rare occurrence for my needs.