![]() |
| Adobe Forums » Software Discussions » Adobe Acrobat » Adobe SDK and Programming » Draw line using Acrobat SDK |
| Tags: |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
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.. |
|
|||
|
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. |
|
|||
|
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.. |
|
|||
|
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); ** |
![]() |
| Thread Tools | |
| Display Modes | |
|
|