Print Page | Close Window

Render Only Portion of Page

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=2644
Printed Date: 04 Apr 26 at 11:06PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Render Only Portion of Page
Posted By: tmills108
Subject: Render Only Portion of Page
Date Posted: 16 May 13 at 2:40PM
Hi,

Is it possible to render only a portion of a page to a DC, or do you always have to render the entire page to a temporary bitmap and then extract the portion you need afterward?

Thanks,
Tom



Replies:
Posted By: Ingo
Date Posted: 16 May 13 at 4:30PM
Hi Tom!
 
As far as i know that's the way...
 
Cheers and welcome here,
Ingo


Posted By: tfrost
Date Posted: 18 May 13 at 11:30AM
Yes, you should be able to simply set the media box with SetPageBox.  I have only done this myself with SaveToFile, to make eight separate A4 PDFs from a huge original drawing, but I assume it also works with rendering.  Worth a quick experiment, anyway!


Posted By: Rowan
Date Posted: 16 Nov 15 at 3:41AM
Hi Guys,

We have added a new function in version 12 called SetRenderArea which will let you render only a portion of the page. The difference between using the CropBox to do this and the SetRenderArea page is that while specifying a CropBox smaller than the actual page size will output the cropped page, the entire page behind the scenes is processed. The SetRenderArea will be faster because it will only process the area of the page that is specified.

http://www.debenu.com/docs/pdf_library_reference/SetRenderArea.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/SetRenderArea.php

Cheers,
- Rowan.


Posted By: mLipok
Date Posted: 16 Nov 15 at 8:23AM
Hi Rowan.
Is it mean I can now really crop page, as I was asking here:
http://www.quickpdf.org/forum/setpagebox-capturepageex-drawcapturedpage_topic3048.html



-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: Rowan
Date Posted: 24 Nov 15 at 3:35AM
Hi mLipok,

SetRenderArea is only going to work when you are rendering the page to an image format using a function such as RenderPageToFile. So it can crop a page when you are rendering to an image, but it won't let you crop an existing PDF and then save it as an update to the PDF. It's only for rendering, not for modifying existing documents.

Cheers,
- Rowan.


Posted By: mLipok
Date Posted: 24 Nov 15 at 6:19AM
Thanks for clarification.

-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: MiodragM
Date Posted: 25 Dec 15 at 9:32AM
Hi Guys,

I'm currently evaluating quick pdf dll and met some potetionally problem.
So, i need to determine empty area (box) on each page at the exact position. For that purpose I use RenderPageToString method and then examin area pixels. The problem is that method RenderPageToString is too slow - for example, the page (A4) has some content on it and method execution for the area 100x30 going to 500 ms.

The pseudo code:
...
sWatch = new System.Diagnostics.Stopwatch();
QP.SetRenderArea(BoxLeftH, BoxTopH, BoxWidth, BoxHeight); //BoxWidth is about 190, BoxHeight is about 30
sWatch.Start();
byte[] K = QP.RenderPageToString(72, selectedPage, 0);
sWatch.Stop();
MS = new MemoryStream(K,false);
...
- sWatch.ElapsedMilliseconds is in range 40-500ms!, depending on the page.

Do I something wrong? Do you have some suggestion?

Thanks,
Miodrag



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk