# Error - ReferenceError: openLInkPriv is not defined

When a doclink is clicked in a PDF file, the following error message appears:

![](/files/-MlFO14n8Lqd7hoQw-98)

The error is caused due to a missing swpdfc.js file which normally installed in the Adobe Reader installation folder automatically.&#x20;

To resolve the issue, create the `swpdfc.js` file (see the code below) and copy it manually to the Adobe Reader installation folder. The default path to the folder is normally "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts", however the actual path on your system may be different.

```javascript
var openLinkPriv = app.trustedFunction( function(dbId, docUnid) {
	app.beginPriv();
	try {
		var depth = 50;
		try {
			depth = this.path.split("/").length;
		}
		catch(e) {
		}
		
		var dirUp = "../";
		var xmlRoot = "";
		var xmlFile = "doclinks.xml";
		var xmlStream = null;
		var count = 0;
		do {
			try {
				xmlStream = util.readFileIntoStream(xmlFile);
			} catch(e) {
				xmlStream = null;
			}
			
			if(xmlStream == null) {
				xmlRoot = dirUp.concat(xmlRoot);
				xmlFile = dirUp.concat(xmlFile);
			}
			
			count++;
		} while(xmlStream == null && count < depth);
		
		if (xmlStream == null) {
			app.alert("XML not found");
			return;
		}
		
		var xml = XMLData.parse(util.stringFromStream(xmlStream), false);
		var xPath = "string(//data/element[@id = '";
		xPath = xPath.concat(dbId);
		xPath = xPath.concat("-");
		xPath = xPath.concat(docUnid);
		xPath = xPath.concat("']/location)");
		var location = XMLData.applyXPath(xml, xPath);
		location = xmlRoot.concat(location);
		app.openDoc(location);
	} catch(e) {
		app.alert("Linked document could not be found: " + location);
	}
	app.endPriv();
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swingsoftware.com/pdf-converter-for-notes/troubleshooting/error-messages/error-referenceerror-openlinkpriv-is-not-defined.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
