Its posible with QuickPDF?
Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=222
Printed Date: 26 Nov 24 at 3:05AM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Its posible with QuickPDF?
Posted By: apicito
Subject: Its posible with QuickPDF?
Date Posted: 23 Dec 05 at 5:32AM
I need:
1. Load a PDF form. No problem.
2. Edit and Write information in form fields. (I donīt have PDF writer).
3. Save modified PDF form.
It's is posible with QuickPDF?
Thanks.
|
Replies:
Posted By: PDFman
Date Posted: 23 Dec 05 at 6:01AM
Very simple, I give sample:
QP.SetFormFieldValueByTitle('adress1', Edit1.Text);
QP.SaveToFile('c:\temp.pdf');
|
Posted By: apicito
Date Posted: 23 Dec 05 at 6:23AM
Thanks. But i not want write fields values by code. I need open PDF form with my delphi application and user write values over de fdf document. After save document with content in database using savetostream method.
Do you undertand?
|
Posted By: apicito
Date Posted: 23 Dec 05 at 6:33AM
Asking of another way:
Is posible show and edit pdf documents with QuickPDF?
|
Posted By: chicks
Date Posted: 23 Dec 05 at 11:00AM
Yes, it's possible with QuickPDF, since it can render PDF to an image. However, it's quite slow, and you need to position and handle the form fields in code. If you want to support javascript in the PDF, you have a lot of work to do. Here's an example which supports text fields only:
http://www.geocities.com/sea_sbs/files/FormTool.zip
Most folks accomplish it by using a tiny local web server, such as tinyweb ( http://www.ritlabs.com/en/products/tinyweb/ ), then create PDF forms that submit to localhost. You then use Adobe Reader to view and submit the forms, and a small cgi behind the local web server that writes to SQLite or some other database.
|
Posted By: mbailey
Date Posted: 06 Jan 06 at 6:41AM
Hi Chicks,
I have tried your FormTool which looks great.
However, when I enter data and move off the field (eg. press TAB) the data I entered disappears and hence I cannot save the data I entered.
Can you suggest what might be causing this.
Cheers,
Mark
|
Posted By: mbailey
Date Posted: 06 Jan 06 at 6:46AM
Whoops!
Please disregard the last message.
When I went back and tried it again I realized my description was incorrect. When I TAB it works fine.
It is only when I leave a field by clicking the mouse on a different field that it loses the data.
One other question though.....
Has anyone converted this to Delphi?
Cheers,
Mark
|
Posted By: chicks
Date Posted: 06 Jan 06 at 12:38PM
Mark,
It's just a simple hack, needs LOTS of work to make it a viable application. Because QuickPDF renders so slowly, it's really not very usable, so I haven't tried to address any defects.
BTW, I just tried Glyph&Clog's xpdf activex control eval, which renders nearly as slowly and costs a whole lot more. Maybe one day I'll look at Foxit's engine, which just keeps getting better judging by their free Reader...
|
Posted By: mbailey
Date Posted: 06 Jan 06 at 5:03PM
Hi Chicks,
Thanx for the relpy.
Had a look at Foxit and unfortunately it did not recognise the fields in my form.
It allows typing anywhere which is not what I am looking for.
I need to distribute forms asking questions from a large number of students and it will be ongoing. Providing a webpage to go to to answer the questions is not an option in this circumstance. Need to send the PDF for as email. They fill it out and email it back.
Each student will only do it once. Hence I cannot ask them to purchase a Form Filler.
Need a free way to give them a filler and I purchased iSEDPDF to create the forms to your Filler using the same tool is terrific. Simple, no frills but it is the only free one I have found.
The rendering is way fast enough for me. Only has one image and two pages.
I would love to do some enhancments but I am a Very Bad VB programmer and would be easier for me to add functionality in Delphi.
Anyway. Thanx.
Kind Regards
Mark
|
Posted By: chicks
Date Posted: 06 Jan 06 at 5:19PM
Actually, it's PowerBasic, not VB, but I'll look into correcting the mouse issue, if viable, this weekend, in the name of Education...
On second thought, if it doesn't absolutely have to be PDF, have a look at Acro Software's FormMax system. You purchase the form creator for $89, and you can create very nice, interactive forms for end users, who only need the free FormMax Filler to fill and save the data.
Supports emailing the filled data back.
|
Posted By: mbailey
Date Posted: 06 Jan 06 at 5:42PM
Hey Thanx Chicks.
I looked at FormMax but discarded due to the fact that I was already able to create the question form inside my database application usin iSEDPDF and I was able to also use it to read the data back off of the form.
Hence, the only missing link was the simple form filler for the students.
iSED/Quick PDF is awesome for what I want to do. Just wish I was clever enough to harness it's fill potential.
;-)
Cheers
Mark
|
Posted By: chicks
Date Posted: 06 Jan 06 at 7:54PM
Mark,
OK, I took a quick stab at this, seems to work OK after about 2 minutes of testing
You can try it out:
http://www.geocities.com/sea_sbs/files/FormToolExe.zip
You (and your students) will need the DLL version of QuickPDF in you path.
|
Posted By: mbailey
Date Posted: 06 Jan 06 at 9:40PM
Hi Chicks.
Excellent.
Do you mind if I try and continue developing this a bit further?
If so, what change did you make to the code.
Certainly, any improvements I will forward back to you.
Cheers,
Mark
|
Posted By: mbailey
Date Posted: 07 Jan 06 at 3:38AM
Hi Chicks,
Wondering if you could advise what the inclide file....
iSQP0441PB.inc does.
Any chance of a copy of it please?
Cheers,
Mark
|
Posted By: chicks
Date Posted: 07 Jan 06 at 10:37AM
Mark,
It's the include file provided for PowerBasic in the DLL version of QuickPDF. The current version is iSQP0511PB.inc
I'll incorporate the change into the source .zip at some point this weekend. I basically copied the code from the tab handler into the mouse left button up handler...
|
Posted By: mbailey
Date Posted: 07 Jan 06 at 7:14PM
Chicks,
Thanx for that.
Got it all to compile with out any errors. However, it crashes when I try and run it.
I had a go at running it in debug mode (animate) found it crashed on this line in the RenderPage SUB
sBuffer = iSEDRenderPageToString(iResolution, iCurPage, 0)
Can you suggest what may be the problem please.
Cheers,
Mark
|
Posted By: chicks
Date Posted: 08 Jan 06 at 1:47AM
Well, I've always suspected that QuickPDF isn't returning a proper PB string, since it's written in Delphi. In fact it crashed on me when I was using sBuffer as a local variable, but works OK when I moved it to a global. I'm using PB 7.x, suppose you're using 8.x
You might try changing the header to return a LONG (or STRING PTR, if that's valid in PB8) instead of a string, and then assign a STRING PTR variable as the return for the function call, say:
LOCAL pStr AS STRING PTR
...
pStr = iSEDRenderPageToString(...)
sBuffer = @pStr
Another option is to try using the COM interface (ActiveX version of QuickPDF), with iSEDRenderPageToVariant() to get the rendered datastream. Or, if all else fails, use iSEDRenderDocumentToFile() as a bitmap and then display that.
I don't plan to upgrade to PB8 (or any later versions, unless the designers start getting with modern language design). It's a very outdated language, I'm looking very seriously at RealBasic as a replacement.
|
Posted By: mbailey
Date Posted: 08 Jan 06 at 1:59AM
Thanx Chicks,
I will try that out.
I know what you mean about PB.
I gave the code away 18 years ago and do most things in eDeveloper. ;-)
After that PB is a real struggle.
Cheers,
Mark
ps. Mind you. If you still like a bit of code but want to get rightout on the bleeding edge....Try Windev.
|
Posted By: chicks
Date Posted: 08 Jan 06 at 2:08PM
Mark,
I was messing with the code, and got this to work. Maybe it'll work in PB8. In the QuickPDF include file, change the return type for iSEDRenderPageToString() from STRING to LONG, then try this code:
SUB RenderPage
LOCAL i AS LONG, id AS LONG
LOCAL h AS DOUBLE
LOCAL scale AS DOUBLE
LOCAL pStr AS STRING PTR
LOCAL lResLen AS LONG
IF rendering THEN EXIT SUB
rendering = %True
MOUSEPTR 11
CALL iSEDSelectPage(iCurPage)
pageWidth = iSEDGetPageBox(2,2)
pageHeight = iSEDGetPageBox(2,3)
pStr = iSEDRenderPageToString(iResolution, iCurPage, 0)
lResLen = iSEDStringResultLength()
sBuffer = PEEK$(pStr, lResLen)
...
If it works, I recommend changing all functions that return STRING in the include to LONG, and use this technique.
|
Posted By: mbailey
Date Posted: 08 Jan 06 at 4:30PM
Hi Chicks,
Tried last change and this one but no go.
Still bombs on the same line
pStr = iSEDRenderPageToString(iResolution, iCurPage, 0)
Might be easier if I just get v7.
Don't waste your time on this just for me. Your .exe works and that is cool.
Cheers.
Mark
|
Posted By: chicks
Date Posted: 08 Jan 06 at 5:01PM
Bummer. Would be nice if PB documented the changes between compilers (or just had better documentation period).
I do have a very basic VB example of using QuickPDF ActiveX to render and display a PDF if would help. Doesn't have the form fields support, though:
http://www.geocities.com/sea_sbs/files/VBViewPDF.zip
|
Posted By: mbailey
Date Posted: 08 Jan 06 at 5:11PM
That's ok thanx Chicks.
The entry of data into the fields and saving the PDF is critical for what I need.
I am no better at VB than PB anyway. :-D
Cheers,
Mark
|
Posted By: chicks
Date Posted: 08 Jan 06 at 6:40PM
OK, well, here's a link to the source and .exe with the update to save field changes when mouse is moved to another field:
http://www.geocities.com/sea_sbs/files/FormTool_.zip
|
Posted By: chicks
Date Posted: 09 Jan 06 at 1:18PM
Mark,
I just ran across this free PDF filler/saver while searching for something else:
http://www.fytek.com/products.php?pg=pdffilesave
Haven't tried it, and have to question whether it violates Adobe's EULA, but there you are.
|
Posted By: dsola
Date Posted: 10 Jan 06 at 3:31AM
Hi,
PDFFileSave by Fytek uses trick wich we used to save PDF Fill Form.
It starts local web server and uses acrobat reader to open/ fill PDF form and adds button with script to send file to his server.
With Indy (delphi) you can do the same.
D.
------------- registered QuickPDF user
|
Posted By: mbailey
Date Posted: 10 Jan 06 at 7:00AM
Hi dsola,
I like Chicks solution better. Clean, lean and functional.
Cheers,
Mark
|
Posted By: chicks
Date Posted: 10 Jan 06 at 11:37AM
Also extremely limited (text fields only, no javascript support, etc.), but 100% legal. Using Reader to save to a local web server is pretty much prohibited by Reader 7's EULA:
You are not authorized to integrate or use the Software with any (a) plug-in software not developed in accordance with the Adobe Integration Key License Agreement or (b) other software or enhancement to programmatically interface with the Software for the purpose of (i) saving data locally (on the same Computer), except when allowed through the use of Document Feature(s) that have been activated using enabling technology from Adobe, (ii) creating a file that contains data (e.g., an XML or comments file), or (iii) saving modifications to a PDF file.
|
Posted By: dsola
Date Posted: 12 Jan 06 at 2:02AM
As you wrote : "pretty much prohibited" :(
But look at this, legal and normal price
FormRouter, Inc. has announced new pricing options for organizations deploying PDF forms that require extended rights such as local save and digital signatures.
http://www.pdfzone.com/article2/0,1759,1824889,00.asp
http://www.formrouter.com/
http://www.formrouter.com/pdf/readerextensions.htm
------------- registered QuickPDF user
|
Posted By: chicks
Date Posted: 12 Jan 06 at 12:19PM
Yes, they are using Adobe's Reader Extensions licensed (and VERY expensive) technology. Same thing the IRS uses for its forms, like the 1040, that are enabled to save locally.
Note they they are charging a minimum of $125 PER PAGE for EACH PDF.
|
Posted By: dsola
Date Posted: 16 Jan 06 at 8:42AM
I think that price is OK for most companies that need to save PDF Forms data.
We'll have 100 PDF Form max.
Price of our app will be little higher to cover this.
It's better then 65,000$ for Adob Document Server.
D.
------------- registered QuickPDF user
|
Posted By: Niels
Date Posted: 12 Jun 09 at 4:01AM
I had the same problem until I found a free pdf reader which supports PDF 1.7 (With Javascript, Form fields, ...) It is fast, small and freeware! http://www.foxitsoftware.com/pdf/reader/ - http://www.foxitsoftware.com/pdf/reader/ And the very good part ist! The user can save all the filled in form fields without and restrictions!!!! I have just deleted Adobe from my harddisk! ;-)
|
|