Adobe Forums

Add Me

Tags:



Reply
LinkBack Thread Tools Display Modes
Draw line using Acrobat SDK
  #1 (permalink)  
Old 11-19-2008, 07:11 AM
Madhav@adobeforums.com
Guest
 
Posts: n/a
Default Draw line using Acrobat SDK

I want to draw line on pdf page. I have x,y coordinate depend upon that i want to draw line on page.

Thanks in advance


Reply With Quote


  #2 (permalink)  
Old 11-19-2008, 07:11 AM
Leonard_Rosenthol@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Using which set of APIs? Plugin, JavaScript or IAC?

Do you want the line to be permanent or temporary?
Reply With Quote


  #3 (permalink)  
Old 11-19-2008, 07:11 AM
Madhav@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Hi Leonard.. Using Acrobat SDK.. Plugin..

want to draw line temporary... How to draw line using Acrobat SDK? Please reply..

Thanks in Advance..
Reply With Quote


  #4 (permalink)  
Old 11-19-2008, 07:11 AM
Leonard_Rosenthol@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Look at the AVPageViewDraw APIs...
Reply With Quote


  #5 (permalink)  
Old 11-21-2008, 07:15 AM
Madhav@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Hi Leonard..

PDEPath lineOne = DrawLine(ASInt32ToFixed(xHit), ASInt32ToFixed(yHit), ASInt32ToFixed(aHit), ASInt32ToFixed(bHit), 1, 1, 0, 0);

using this function i am drawing line.

Line should be draw when i click on page, it get coordinate and line draw. but it draw line anyever in the page. i want line should be draw on click point i.e. second time click(i.e. (x1,y1),(x2,y2));

How to draw line on the page with selected coordinate?
reply urgently..
Thanks in advance..
Reply With Quote


  #6 (permalink)  
Old 11-21-2008, 07:15 AM
Leonard_Rosenthol@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

I don't know what your DrawLine() function is doing there - but if it is using PDEPath, you are doing the wrong thing since that's a permanent line on the page and not a temporary one.

How you are getting the click coordinates? Do you have a custom tool? If so, then you should have all the coords that you need.
Reply With Quote


  #7 (permalink)  
Old 11-22-2008, 06:56 AM
Madhav@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Hi Leonard..

how to change user space to device space?

I am using AVPageViewRectToDevice API for change but not working properly.
I have user space coordinate in x,y now i want to convert into device space coordinate. please reply..

Thanks in advance..
Reply With Quote


  #8 (permalink)  
Old 11-22-2008, 06:56 AM
Leonard_Rosenthol@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Those are the correct APIs to convert from user space to device space (and back again). I don't know why you believe it isn't "working properly"...
Reply With Quote


  #9 (permalink)  
Old 11-22-2008, 06:56 AM
Madhav@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

sample code for drawing line..
whenever click on page i get x,y coordinate. and i have passed these coodinates to this function and it work properly. but it draw line anyever not on click between two point.. please give me some suggestion..

void InitilizeDrawLine(AVPageView pageView, AVDevRect avRect, AVDevCoord xHit, AVDevCoord yHit, AVDevCoord aHit, AVDevCoord bHit)
{

pdPage = AVPageViewGetPage(pageView);
PDEContent pdeContent = PDPageAcquirePDEContent(pdPage, 0);
PDPageGetMediaBox(pdPage, &mediaBox);

AVPageViewDevicePointToPage(pageView, xHit, yHit, &asFixedPt);
AVPageViewDevicePointToPage(pageView, aHit, bHit, &asFixedPt);

AVPageViewDeviceRectToPage(pageView, &avRect, mediaBox);

PDEPath lineOne = DrawLine(ASInt32ToFixed(xHit), ASInt32ToFixed(yHit), ASInt32ToFixed(aHit), ASInt32ToFixed(bHit), 1, 1, 0, 0);
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)lineOne);

PDPageSetPDEContentCanRaise(pdPage, 0);
PDPageNotifyContentsDidChange(pdPage);

PDPageReleasePDEContent(pdPage, 0);
PDERelease((PDEObject)lineOne);
**
Reply With Quote


  #10 (permalink)  
Old 11-22-2008, 06:56 AM
Leonard_Rosenthol@adobeforums.com
Guest
 
Posts: n/a
Default Re: Draw line using Acrobat SDK

Look at your code! You are calling the conversion routines and then throwing away the results - and then not even bothering to use them .
Reply With Quote


Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Hairstyles | UFO Videos | Bollywood Wallpapers | Poems  | WWE


All times are GMT. The time now is 07:32 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.