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!
![]() |
Merging Pages - No Error - No Result |
Post Reply
|
| Author | |
neuroscript
Beginner
Joined: 19 Mar 10 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Merging Pages - No Error - No ResultPosted: 19 Mar 10 at 8:18AM |
|
I've tried countless approaches. All return successful results (return codes from functions) but yield a document w/o the actual results.
Here's the scenario: 1. Drawing application using MoveTo, LineTo functionality of C/C++. 2. When user is finished drawing, GetCanvasDC is called and used to redraw the same thing the user sees on screen. 3. LoadCanvasFromDC is called to create a new doc from these drawing methods. It is then saved and the resultant PDF doc looks as it should. 4. User continues to draw. 5. Next step is to add the new drawings to the existing (previously saved) doc. Since GetCanvasDC/LoadCanvasDC functions create a new document, I needed to find a way to merge these docs. I've tried LoadCanvasDC with both image & vector. I've tried CapturePage/DrawCapturedPage. I've tried rendering each page to an image and then creating a new page (and new doc with new page) and adding/selecting these images then drawing. I've, essentially, tried every option I could find. All function calls return a successful result. The resultant PDF (in each case) does NOT have the result I need. That is, there is no combination of these 2 drawn images (which essentially are vectors). Ultimately, NOTHING shows up for drawing (image or captured page). The concept of the application: Draw->Save. Close app. Load app. Load saved doc. Add more drawings atop the original. Save. The drawing are merely lines. NOTE: Pages are set to "letter landscape" before LoadCanvasDC is called. I've also ensured I've selected pages, images, etc. The code has changed so many times, that posting it would be useless. The bottom line is: How in the heck can this be done? Thanks. |
|
![]() |
|
neuroscript
Beginner
Joined: 19 Mar 10 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 Mar 10 at 9:27PM |
|
I've tried working further with the "RenderPageToFile" option (using PNG), then creating a new doc and adding and drawing the two images. This works, except that there is no transparency, so the 2nd drawn images covers the first. So, it seems this won't work.
Since the LoadCanvasDC has an option to save as vectors (not as a graphic), I would "think" there would be a way to extract the vectors when opening the document. Unfortunately, I have not found a way to do this. Any thoughts? |
|
![]() |
|
neuroscript
Beginner
Joined: 19 Mar 10 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 Mar 10 at 9:46PM |
|
OK. Thanks for all the help everyone ;D
I figured it out, thanks to a C# example for adding/drawing images. As well, I saw an unrelated post mentioning that a page's vertical origin is at the bottom. So, it appears that my calls to DrawCapturedPage required the "top" input parameter to be the height of the page to be drawn...NOT 0. However, in order to get the dimensions, I rendered the page to an image file and added it to the document. Is there a more direct method to get the dimensions of a captured page? |
|
![]() |
|
Rowan
Moderator Group
Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 Mar 10 at 10:49AM |
|
There are a couple of ways to get the dimensions of a page.
Using the PageWidth and PageHeight functions is probably the easiest method. You can see an example of how the DrawCapturedPage and PageWidth and PageHeight functions can be used in combination in this PDF page overlay sample. Another way to get the page dimensions would be to use the GetPageBox function. Use this function to return the dimensions of the page's crop box (the visual region of the page). Hope this helps.
|
|
![]() |
|
neuroscript
Beginner
Joined: 19 Mar 10 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 Mar 10 at 7:17PM |
|
It does help, thanks Rowan.
Although I had gotten it to work, this eliminates an unnecessary step. |
|
![]() |
|
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