Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PDAnnotの値について

Explorer ,
Apr 30, 2023 Apr 30, 2023
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);
TOPICS
Windows
381
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 30, 2023 Apr 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 thi

...
Translate
LEGEND ,
Apr 30, 2023 Apr 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 30, 2023 Apr 30, 2023
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines