pdf and netbeans - pdf

I am using netbeans to develop my project. I need to put a pdf on a website and according to certain conditions, only parts of the pdf should be view-able.For example, suppose payment made is rs.500. I will let the user view 2 chapters in the pdf for a period of one week. I have no idea how to do this.Can someone help me?

Since you're using NetBeans, I'll assume that you're using Java as your language.
You generate PDFs using either XSL-FO or something like iText. I prefer XSL-FO and Velocity templates, but your situation might be different.
The rules for what to display under different conditions need to be expressed in Java using controllers that accept a request, bind parameters to objects, execute rules, and stream the response as a PDF depending on the outcome. It's not an easy answer.

There are various Java viewers and several have plugins (there is one at http://www.jpedal.org/support_siNetBeans.php).
Your best bet would be to generate a copy of the PDF with just the pages allowed and then display that.

Related

Annotate the pdf file on the location clicked by user

I am having trouble in trying to find the solution for the below described problem.
Annotate the PDF file when user clicks on specific location in pdf and then finaly save the pdf which in future opens at annotated location.
How to approach this?
What I have tried.
I have tried to find various libraries irrespective of programming language (since programing language is not the dependency)- found few libraries like minipdf in python, pdfbox in java to mention few relevant ones. Finally selected pdfbox since it seemed to be mature enough to provide the solution closeby.
There are various hurdles now how to get user the location clicked by the user? since after getting the location I can able to perform various actions like annotating at the clicked location and then saving the pdf on the same specific location.
It seems I have to write whole pdf javascript to approach it but again how to do so?
I had similar problem and have solved it the other way. In my case I am not opening PDF in Adobe reader, but in browser. So what I did is converted the pdf to html using python libraries (Let me know if you are interested, I will share different library names with their pros and cons).
Now that html can be edited easily. We can put hyperlinks, highlights everything there as source code is with us.
This workaround may be applicable to you if your front end is web based.
PS: Wanted to post this workaround as comment, but couldn't due to little less reputation count as of now. Hope, it won't be downmarked :)

Selecting text and image from pdf through any programming language

I'm trying to develop a tool/web application such that it will import a PDF file and I need to select text and images available in PDF by selecting them with a mouse click and marking them as title,content and image with a button click (3 different button) where the marked contents and image will be copied to clipboard or will be pasted into a word document which is going to be a another part. So in which programming language is this possible to work with and carry on ?
I'd probably try researching pure browser-side solution using pdf.js and clipboard API.
Otherwise, you'd still need clipboard API in the browser and the server-side may actually be powered by any programming language which can be hooked into a web server and has a library to parse PDFs.
You said nothing at all about your prospective server platform but to name a few, .NET has PdfSharp which is able to read PDFs, Python has a host of tools available for it. After all, there exist a bunch of command-line utilities to extract data from PDF which can be called using any PL able to call external processes.
Note that this only appears to be a simpler solution than using pdf.js but note that unless your PDFs are really uniform (say, invoices created by some piece of software), and so you'll be able to make your PDF parser know which bits of data it has to extract and return, the parser will need to returl all the data it extracted to the client, and you'll need to somehow render it all there. May be it's exactly what you need but maybe not.
Since PDFs are really tailored for typesetting and not presenting information in a structured manner, I'd try to piggyback on an already hard-core PDF rendering solution which runs in the browser, so see above.

How to make web apps to read and analyze pdf file?

I have a project from my lecture to create a web apps to read and analyze a pdf file based on keywords. What kind of programming language that I can use?
Example : I need to find or check some keywords or data on the pdf file. If the keyword or data is exist and available, the result is true.
I usually work in javascript so could answer you in that, I had a great help from the below conversation, it might be a good help for you too.
extract text from pdf in Javascript

Document creation libraries and formats?

I am going to start my final project for spring semester at school and looking at feasibility before I put my leg in it. One of my potential projects requires me to make an archiveable document of web sessions. These archives should be searchable (and if possible with pretty design). PDF and Open Document formats are in mind for now. Is there any thing else I can look into besides these ? I want to make sure that I pick the right plan before my school starts so that I can be confident about it. I have to use C#.NET for this.
Any suggestions are welcome.
Regards,
Lalith
If you want to convert logs into PDF, You can use Third Party Libraries. There are plenty of c# .NET VCL are present. Like,
iTextSharp(Not free for Commercial use)
Report.NET(free,No Support)
PdfSharp(free,No Support Yet)
Gnostice PDFOne .NET(Non Free,With full help,support)
But if you want to create PDF using c# yourself, it is a pretty hard work since PDF uses PostScript which may be very new and complex to you. First Study the format you are going to use and make sure you can implement it. I would suggest to stick with PDF since its platform,editor independent.
http://www.gnupdf.org/Category:PDF

Are there any services out there that will let me convert an URL to PDF and let the user download the result?

I have a lot of different sites written in PHP (Drupal) and more and more often clients ask me to create PDFs of various lists, product descriptions and so on.. I've been using dompdf and other pdf libraries but they are a pain to use and have a very limited functionality.
Are there any services out there that'll let me generate a PDF file from a URL and let the user download the result? That would definitely save my day :)
Best regards,
Thomas
If you are trying to convert html to PDF, then there are a couple of services out there which can do that for you (search), but from the top of my head a2ps does a pretty ok job. The basic idea if that if you can generate PostScript from your source, then creating a PDF is not an issue.
If you are looking for a more feature full library then iText can do it (Java though and not free for commercial use).