Hi!
I'm developing an own viewer with your PDF-Viewer as basic.
One workflow is:
- the user create a rectangle-annotation on a page in the pdf
- than the user selects categories for this annotation (inside our own program)
(this categories and the annotation information will be saved in an own database)
For some of the categories I need the content of the annotation as a picture to save in the database for later use.
How do I do this?
I know the snapshot tool. With this, the user can select an area (rectangle) on the pdf page and automatically the picture is copied to the clipboard. What does the function behind? There must be the possibility to get an area of the pdf page as image, such as the snapshot tool is doing it.
So - how can I do this? Can you give me a hint? I've searched the documentation and also the forums, but I could not find what I need.
Thanks in advance!
best regards,
Lars Mq from Germany
"Snapshot" of content inside a rectangle
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 3
- Joined: Wed Oct 19, 2011 12:00 pm
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: "Snapshot" of content inside a rectangle
Hello Lars,
You should be able to render and store as image any portion of any page of a PDF using the Viewer's Simple SDK - but that will require you first saving the file that is modified by the user - and then opening and rendering the needed rectangle separately using the Simple SDK.
I have now passed this to our devs and asked them to advise if there is a way to achieve what you need (an image of a portion of a page in the clipboard) via code and using only the Viewer AX SDK while the document is opened.
We will update the topic with any news and advises we have.
Best,
Stefan
You should be able to render and store as image any portion of any page of a PDF using the Viewer's Simple SDK - but that will require you first saving the file that is modified by the user - and then opening and rendering the needed rectangle separately using the Simple SDK.
I have now passed this to our devs and asked them to advise if there is a way to achieve what you need (an image of a portion of a page in the clipboard) via code and using only the Viewer AX SDK while the document is opened.
We will update the topic with any news and advises we have.
Best,
Stefan
-
- User
- Posts: 3
- Joined: Wed Oct 19, 2011 12:00 pm
Re: "Snapshot" of content inside a rectangle
Hi Stefan,
thank you for the answer. One note / additional explanation to your following sentence:
Your snapshot-tool is doing it somehow: The user selects an area (rectangle) in the pdf. After release of left mouse-button, the snapshot-tool "cuts" the selected area, transforms it into an image and puts this image into the clipboard.
I would like to select the area via code, and cut of the selected area to transfer it to an image object. This image object I would like to save in the database, or use somehow else (show in another form or other things).
Thanks and best regards,
LarsMq
Thanks:)
Lars
thank you for the answer. One note / additional explanation to your following sentence:
I need the portion of a page NOT in the clipboard: I would like to get a portion of a page as an image object.Tracker Supp-Stefan wrote: [...] (an image of a portion of a page in the clipboard) via code and using only the Viewer AX SDK while the document is opened. [...]
Your snapshot-tool is doing it somehow: The user selects an area (rectangle) in the pdf. After release of left mouse-button, the snapshot-tool "cuts" the selected area, transforms it into an image and puts this image into the clipboard.
I would like to select the area via code, and cut of the selected area to transfer it to an image object. This image object I would like to save in the database, or use somehow else (show in another form or other things).
Thanks and best regards,
LarsMq
Thanks:)
Lars
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: "Snapshot" of content inside a rectangle
I'm afraid there is no way to do it programmatically.
PDF-XChange Co Ltd. (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 3
- Joined: Wed Oct 19, 2011 12:00 pm
Re: "Snapshot" of content inside a rectangle
Hi Ivan,Ivan - Tracker Software wrote:I'm afraid there is no way to do it programmatically.
sorry, but this answer I can't accept.
Your Viewer has the snapshot tool. This tool is - programmatically - cutting of a rectangular area as an picture, and puts this picture into the clipboard.
So - there is a way to do it programmatically
I would like to know, how it works. If you don't have a direct method/function in your dll's - ok. But you are doing it somehow, so than please give me a hint, what kind of functions of the low level API you are using.
Thanks!
Best regards,
Lars
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: "Snapshot" of content inside a rectangle
Hello Lars,
Ivan had in mind that it's not possible to be done directly with the controls made available to you in the SDK you are currently using.
You can use the Simple Viewer DLL SDK to render any portion of any page to a Device Context (and you can then create your own image file from that data) - but that's not available in the Viewer AX SDK - so you will need to close the file (or create a non-locked copy of the PDF with the annotation, and then render the needed section. You will also need to obtain and pass the information for the area to be "snapshot-ed" from the AX to the Simple DLL SDK.
Best,
Stefan
Ivan had in mind that it's not possible to be done directly with the controls made available to you in the SDK you are currently using.
You can use the Simple Viewer DLL SDK to render any portion of any page to a Device Context (and you can then create your own image file from that data) - but that's not available in the Viewer AX SDK - so you will need to close the file (or create a non-locked copy of the PDF with the annotation, and then render the needed section. You will also need to obtain and pass the information for the area to be "snapshot-ed" from the AX to the Simple DLL SDK.
Best,
Stefan