Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Cannot Draw anything |
Post Reply ![]() |
Author | |
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() Posted: 15 Feb 07 at 7:02PM |
I just started with QuickPDF (thanks to Ingo) and some things I can do, some not. Using xHarbour+FWH
I can: - Use the DLL handle and open it - Open the existing PDF (test1.pdf) - Add a new page to this PDF - Write the new PDF (test2.pdf - which now is larger in bytes) When I open this new page (test2.pdf) I see the newly added page. So far so good. What I cannot I cannot Draw any text on any page, including the newly created page! The "code" is as follows: LoadFromFile("test1.pdf") // Has two pages! r := Newpage() // now we have 3 pages AddStandardFont(4) SetTextSize(10) SelectPage(r) DrawText(100,500,"SOME TESTED TEXT") SaveToFile("test2.pdf") // test2.pdf now has 3 pages! The text is not visible on the page number 3! If I try to write any text to the page 2 or 1, the same problem. This is why I added a new page to check if maybe the existing content of the pages 1 and 2 are preventing me to see what is drawn. The strange situation arises also if I do NOT add a new page and write the text onto page 1 or 2. The resulting test2.pdf is LONGER in bytes than test1.pdf, but I cannot see what I drowe! ? I am probably doing wrong something but cannot find what. I desperately need help because if I cannot write onto the existing pages content, I cannot use this DLL. And it seams so promissing (one of the best things for programaticaly PDF handling I found by now) Please help Boris |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Boris!
Please first try the samples from the original iSED-site: http://isedquickpdf.com/?pg=kb You unlocked the library? Best regards, Ingo |
|
![]() |
|
ukobsa ![]() Senior Member ![]() Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
![]() ![]() ![]() ![]() ![]() |
Boris,
which version of QuickPDF are you using? I have tested it on my system and here it works fine (ok, it was not the dll version but my source version). Another idea: can you try to draw the text on position (50,50)? If it works fine then you should see the text on the lower left part of your page [Reason: if you have a small page (i.e. A5) then drawing on (100, 500) could draw it outside the page] HTH, Ulrich |
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
- My library version reports: 5.11 - yes I unlocked the DLL, othervise it would not make another PDF and save it to disk. yes, I followed one of the samples after loading the test1.PDF (100K long) nSelected = SelectedDocument() SetOrigin(1) SetmeasurementUnits(1) f1 = AddStandardFont(4) f2 = AddStandardFont(5) f3 = AddTrueTypeFont("Verdana",0) SelectFont(f1) SettextColor(1,0,0) SettextSize(24) Drawtext(15,15,"Some RED text from Boris") SelectFont(f2) SettextColor(0,0,1) SettextSize(46) Drawtext(105,50,"Some BLUE text from Boris") RemoveDocument( nSelected ) Then I saved to a new test2.PDF which shows 102K long, meaning there IS some content, but is invisible? Maybe bacause of LAYERS? Maybe my text was BEHIND the existing content? I feel I am so close and so far at the same time :( regards Boris Edited by Boris - 16 Feb 07 at 7:04AM |
|
Better to write programs than not to write programs...
|
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I am using 5.11 ( as reported from the function LibraryVersion() ) I tried to write on the positions 15,15 and also on 105,50 The same result. The main problem is that the newly saved test2.PDF HAS some new content in comparation woth test1.PDF (the original) because is bigger size than original... My original PDF page sizes are A4 Regards Boris |
|
Better to write programs than not to write programs...
|
|
![]() |
|
ukobsa ![]() Senior Member ![]() Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
![]() ![]() ![]() ![]() ![]() |
Boris,
can you try it with version 5.14 or 5.21 (look for 'Library Downloads' section)? And if this doesn't help, can you email the created PDF to support/at/quickpdf.org best regards, Ulrich |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Boris!
Only for testing: There're a lot of tools for textextraction... Can you extract (and then see) your text from the document? Best regards, Ingo |
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I downloaded the 5.21 and have the same problem ![]() |
|
Better to write programs than not to write programs...
|
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo, the situation is as follows: 1. The tutor1.PDF is used as the start file and is of length 10,852 and 1 page 2. When loded I select page 1 and write some text ono the first page 3. Then I add a new page so now we have 2 pages 4. I select the page 2 and write some text onto the page 2 5. I save the new file tutor2.PDF 6 I ExtractFilePages() from tutor2.PDF and write it into tutor3.PDF 7. I ExtractFilePageText() from the 1, page from tutor1.PDF and got all the text on that page, it is unchanged as original 8. I ExtractFilePageText() from the 1. page from tutor2.PDF and got all the text on that page. It should have my text written on this page, but it also show only the original text as in tutor1.PDF 9. I ExtractFilePageText() from the 2. page from tutor2.PDF and got nothing! It should show at least one string I wrote onto the second page I added. This second page is visible when open it with viewer, but is empty. The lengths: tutor1.PDF = 10,852 tutor2.PDF = 12,982 (created from tutor1 + text + new page) tutor3.PDF = 12,715 (created from tutor2 only first page) Files: Tutor1.pdf the original, unchanged Tutor2.pdf (The changed with text on first page, a new page and text on it) Any ideas? Can you load tutor1.pdf, put some text on the first page, add a new page and put some text on second page, then tsave it to tutor2.pdf and see the text when viewing? Thank you Regards Boris Edited by Boris - 16 Feb 07 at 9:01AM |
|
Better to write programs than not to write programs...
|
|
![]() |
|
marian_pascalau ![]() Debenu Quick PDF Library Expert ![]() Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
For those who care here is a small VBS program to test the QuickPDF ActiveX capabilities. Boris, this test was made specially for your problem. It shows that the PDF creation it works as expected. But of course I have never used the 5.11. Please register the latest ActiveX dll (5.21) and try again: <Test cmd-file="test.bat"> copy testdrawtext.pdf testdrawtext-2pages.pdf open testdrawtext.pdf open testdrawtext-2pages.pdf rem for a custom test run <Script filename="PDFTester.vbs"> ' On error Quit with exit code 1 function main(args) if iPDF.UnlockKey("your quickpdf key") <> 1 then if args.Count = 0 then dim ndoc, npage call processPage(iPDF, npage, args(i)) set iPDF = Nothing function processPage(iPDF, npage, pdffile) call iPDF.AddStandardFont(4) call iPDF.SaveToFile(pdffile) end function </Script> |
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
Marian,
Thanks for your time. I am using 5.21 now I never used this kind of apporach you suggest, so I don't know what to do with the script you sent :( Is this some text file I have to create? Can you explain me please, where to load the script and how to run this test? regards Boris |
|
Better to write programs than not to write programs...
|
|
![]() |
|
Boris ![]() Team Player ![]() ![]() Joined: 15 Feb 07 Location: Belgrade Serbia Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
Hey people, I solved it! :)
The main problem was the fact xHarbour does not use so stritly defined variable types. We basicaly have DOUBLE, INT, WORD and LONG Whatever I put as the variable type in the finction DrawText() it didin't print anything! Finaly I found that we can also use _DOUBLE variable type (11) and this did the whole trick! Now I can print wherever I want, save the changed PDF and have all the data written on the proper location pf PDF If someone is working in xHarbour + Fivewin, I am here to help and explain and send the sample code. I really don't like the idea someone else should spent 2 days of a very hard work and hear pulling like me. :) Now I can continue testing and working with xHarbour as before. Printing PDF as I need it. Ingo, thanks again for helping with the demo key. I am sure after a few days of testing I will buy this DLL retail key regards to all, it's time to get some rest. :) Boris |
|
Better to write programs than not to write programs...
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store