DocuSign API新手:创建信封时TAB_PAGE_NUMBER_NOT_SPECIFIED报错求助
Hey there, let's work through why you're hitting that TAB_PAGE_NUMBER_NOT_SPECIFIED error when creating envelopes. The message says your "SignHere" tab is missing a page number or anchor tab item, even though it looks like you've configured both in your code. Here are the most likely culprits and how to fix them:
1. Mismatched RecipientId
Looking at your code, your SignHere tab has RecipientId = "2", but your Date tab uses RecipientId = "1" — and I'm guessing your SignerModel objPerson is set up with RecipientId "1" too. DocuSign requires every tab to link to an existing recipient. If there's no recipient with ID "2" defined, the system will flag the SignHere tab as misconfigured, leading to that missing page number/anchor error.
Fix:
Align the SignHere tab's RecipientId with your signer's RecipientId. If your signer uses ID "1", update the tab code like this:
objPersonSignHere.RecipientId = "1";
2. Anchor Text Might Be Unrecognizable
Your HTML uses white text for the anchor strings (style="color:white;"). When DocuSign converts your HTML to a PDF, it might ignore text that matches the background color — meaning it can't find pleasesignhereBP at all. Even though you set AnchorIgnoreIfNotPresent = "true", if the tab isn't linked to a valid recipient and the anchor can't be found, the system still throws the error.
Fixes:
- Temporarily change the anchor text color to black to test if DocuSign can pick it up:
<span style="color:black;">pleasesignhereBP</span>
- If you need to keep the text hidden, add a transparent border to ensure the text element is preserved in the PDF:
<span style="color:white; display: inline-block; border: 1px solid transparent;">pleasesignhereBP</span>
3. Double-Check Anchor Configuration Details
Make sure your anchor settings are complete and correct:
- Confirm
DocumentId = "1"matches the ID you assigned to your uploaded document. - Verify
AnchorUnits = "cms"is what you intend (DocuSign defaults to pixels, but cms is valid if that's your preferred unit). - Ensure
AnchorXOffsetandAnchorYOffsetvalues make sense for where you want the signature to appear relative to the anchor text.
Quick Example of Corrected Code (Key Sections)
// Set up your signer with the correct RecipientId SignerModel objPerson = new SignerModel(); objPerson.RecipientId = "1"; // Add other signer details (email, name, etc.)... // Configure SignHere tab with matching RecipientId SignHereModel objPersonSignHere = new SignHereModel(); objPersonSignHere.DocumentId = "1"; objPersonSignHere.PageNumber = "1"; objPersonSignHere.RecipientId = "1"; // Matches the signer's ID objPersonSignHere.AnchorString = "pleasesignhereBP"; objPersonSignHere.AnchorXOffset = ".2"; objPersonSignHere.AnchorYOffset = ".01"; objPersonSignHere.AnchorIgnoreIfNotPresent = "true"; objPersonSignHere.AnchorUnits = "cms"; // Configure Date tab (keep RecipientId consistent) DateModel objPersonDate = new DateModel(); objPersonDate.DocumentId = "1"; objPersonDate.PageNumber = "1"; objPersonDate.RecipientId = "1"; objPersonDate.AnchorString = "pleasedatehereBP"; objPersonDate.AnchorXOffset = ".2"; objPersonDate.AnchorYOffset = ".01"; // Add other required Date tab properties... // Attach tabs to the signer TabsModel objPersonTab = new TabsModel(); objPersonTab.SignHereTabs = new List<SignHereModel> { objPersonSignHere }; objPersonTab.DateTabs = new List<DateModel> { objPersonDate }; objPerson.Tabs = objPersonTab;
Go through these checks, and you should be able to resolve that error and successfully create your envelope.
内容的提问来源于stack exchange,提问作者Ragesh Puthiyedath Raju

