Skip to main content
Known Participant
Apr 30, 2023 9:16 AM UTC
Answered

PDAnnotの値について

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 is closed to new replies. Start a new post to keep the conversation going.
Test Screen NameCorrect answer
Legend
Apr 30, 2023 11:11 AM UTC

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.

2 replies

Test Screen NameCorrect answer
Legend
Apr 30, 2023 11:11 AM UTC

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.

Translate
Known Participant
May 1, 2023 1:16 AM UTC

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

Translate