2013-03-15 98 views

回答

0

FlexPaper提供了一個名爲getMarkList的JavaScript函數:

marksArray = JSON.stringify($FlexPaper('documentViewer').getMarkList()); 

您可以再次申請註釋使用addMarks:

var initialMarks = JSON.parse(marksArray); 
$FlexPaper('documentViewer').addMarks(initialMarks); 

這適用於HTML5的版本,但我懷疑這也將適用於Flash和HTML版本。

0

好的,所以我想我已經發現Flexpaper中的一個錯誤,它阻止了它的使用(錯誤在Flash版本中,沒有測試過HTML版本)。如果有人真的有這個工作在Flash上​​,請讓我知道!

基本上,addMark()正在執行不必要的座標變換,這使得它無法放回你已經在同一地點(這隻似乎是音符的情況下提取的標記,圖紙似乎沒有這個問題)。

下面是如何重現:

轉到http://devaldi.com/annotations/UK_Investment_Fund.php?ro=flash,html並開啓Chrome JS控制檯。輸入以下命令:位置

>> note = $FlexPaper('documentViewer').getMarkList()[2] 
Object {width: 200, pageIndex: 1, height: 180, note: "The annotations plug-in allows both highlighting a…created↵↵Notes can be resized, moved and deleted.", id: "3AFE17A3-4977-3ECA-C468-70F2C40B81E8"…} 

>> // Now try to add back in the same annotation 
>> $FlexPaper('documentViewer').addMark(note) 

>> // Notice that on the screen the note is in the wrong spot 
>> // (not the same spot as the original one). Lets check the positioning 

>> added_note = $FlexPaper('documentViewer').getMarkList()[6] 

>> added_note.positionX 
356.718192627824 

>> note.positionX 
-5.463702 
0

正規化/非規範化應該只要罰款,你設置「displayFormat」到「HTML」作爲對象創建的一部分工作。規範化過程基本上調整X/Y /寬度/高度,以便文檔被認爲是1000的高度。如果文檔的高度與flash或html不同,則查看器在顯示註釋時調整位置。當然,它也將文檔寬度/高度的比例視爲此過程的一部分。

全部最好 FlexPaper團隊的Erik