Skip to main content
Known Participant
April 30, 2023
Answered

PDAnnotの値について

  • April 30, 2023
  • 1 reply
  • 388 views
acrobatのSDKを使い、プラグイン開発をしていますが、わからないところがあるので、教えてください。下記のコードは3D注釈を追加するためのコードの一部です。その中でpdAnnot及び、cosAnnotの値が a=-1073741824 b=45 となり,その後のコードでacrobat上で”文書読み取り中にエラーが発生しました。(44)”となってしまいます。a=-1073741824は異常と思いますが、なにがいけないのでしょうか?わかる方がいましたらよろしくお願いします。
 
PDPage pdPage = AVDocGetPageView(avDoc) ? AVPageViewGetPage(AVDocGetPageView(avDoc)) : NULL;
 
ASAtom annotSubtype = ASAtomFromString("3D");
ASFixedRect initialRect = { ASInt16ToFixed(0), ASInt16ToFixed(50), ASInt16ToFixed(50), ASInt16ToFixed(100) };
PDAnnot pdAnnot = PDPageAddNewAnnot(pdPage, annotSubtype, PDPageGetNumAnnots(pdPage), &initialRect);
 
CosDoc cosDoc = PDDocGetCosDoc(pdDoc);
CosObj cosAnnot = PDAnnotGetCosObj(pdAnnot);
This topic has been closed for replies.
Correct answer Test Screen Name

The contents of PDAnnot and CosObj are "opaque". This means, Acrobat keeps them there and we cannot know the meaning. I can tell you that the value a=-1073741824 b=4 looks perfectly normal. You can check the Cos object values with CosObjGetType, CosObjGet...Value etc.

 

To get more details with an error like "Problem reading a document (44) you can use Ctrl+OK (hold down Ctrl key and click OK). The error is more detailed, but still does not tell you where is the fault. I cannot see anything in this piece of code which will damage a PDF.

1 reply

Test Screen NameCorrect answer
Legend
April 30, 2023

The contents of PDAnnot and CosObj are "opaque". This means, Acrobat keeps them there and we cannot know the meaning. I can tell you that the value a=-1073741824 b=4 looks perfectly normal. You can check the Cos object values with CosObjGetType, CosObjGet...Value etc.

 

To get more details with an error like "Problem reading a document (44) you can use Ctrl+OK (hold down Ctrl key and click OK). The error is more detailed, but still does not tell you where is the fault. I cannot see anything in this piece of code which will damage a PDF.

Known Participant
May 1, 2023

いつも返答いただきありがとうございます。Ctrl+OKは知りませんでした。おかげさまで、投稿したコードではなく、その後のコードの CosNewStream に問題があったとわかりました。