Read and replace URL from PDF file
Naming


Helper, although very common, is too generic as class name. Imagine it in a package with two dozens of other classes, how would you have a hint on what it is supposed to do by browsing the package? If it was named something like PdfAnalyzeHelper or PdfProcessingHelper, that would be better.
Looking at the name of the method getURL(args), I was expecting to find a return value instead of void, which was confusing. The prefix get* in method names is often used for getters. Since this method does not return anything and executes some URL processing, that should be called, for example, replaceReportIdInUrls(args).


SRP

The single responsibility principle seems to be violated in this method. I see three distinct things done:


Loading a PDF file.
Reading the file and replacing values in URLs.
Saving a new PDF file.


I'd suggest to split it into three distinct methods. It will be easier to maintain and reuse, if this is intended. Or, since the I/O with PDDocument is very concise, remove it from the method body and change the signature to

public static PDDocument replaceReportIdInUrls(PDDocument doc, 
                                               String reportIdOld,
                                               String reportIdNew);


try-with-resources

The I/O with finally { doc.close(); } is plain old before-Java-7 style. It can be simplified for

try (PDDocument doc = PDDocument.load(oldpdf)) {
     // method body
} catch (IOException | COSVisitorException e) {
     // multicatch is also helpful!
}


This shortens the method for at least 12 lines!

Generics

The version of PDFBox that you use seems to be a legacy one, PDDocumentCatalog.getAllPages() somehow returns an unbound List.
In order to (at least) avoid compilation warnings, type bounds should be added, for example:

List&lt;?&gt; allPages = doc.getDocumentCatalog().getAllPages();


According to the javadoc, the list should contain PDPage objects, so if you dare rely on it, you can try a cast to List&lt;PDPage&gt;.

The same comment concerns the next List of annotations. Strangely, the javadoc describes it as typed, so only &lt;PDAnnotation&gt; should be added to the declaration.

For Loops

The j index of the inner loop is not reused, so it would be simpler to rewrite the loop:

for (PDAnnotation annotation : annotations) { ... }


and this will make useless the call annotations.get(j);

The same is about the outer loop, but since the i index is reused for the output, it can be kept.

Validation

The line

String reportID = oldURL.substring(oldURL.lastIndexOf("=") + 1, oldURL.length());


is not secured against the case when the URL does not contain the "=" character. oldURL.lastIndexOf("=") may return -1, in such case a StringIndexOutOfBoundsException will be thrown.

By the way, no validation at all is done for the method input params. What happens if one of them is null or empty?