Skip to content

Commit

Permalink
#180 Add warning if we can not find the hash link target.
Browse files Browse the repository at this point in the history
  • Loading branch information
danfickle committed Nov 11, 2018
1 parent ffb0573 commit 1d36988
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import com.openhtmltopdf.render.BlockBox;
import com.openhtmltopdf.render.Box;
import com.openhtmltopdf.render.RenderingContext;
import com.openhtmltopdf.util.XRLog;

import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.interactive.action.PDAction;
Expand All @@ -27,6 +29,7 @@
import java.util.*;
import java.util.List;
import java.util.Map.Entry;
import java.util.logging.Level;

public class PdfBoxFastLinkManager {

Expand Down Expand Up @@ -217,6 +220,8 @@ private void addUriAsLink(RenderingContext c, Box box, PDPage page, float pageHe
return;

addLinkToPage(page, annot);
} else {
XRLog.general(Level.WARNING, "Could not find valid target for link. Link href = " + uri);
}
} else if (uri.contains("://")) {
PDActionURI uriAct = new PDActionURI();
Expand Down

0 comments on commit 1d36988

Please sign in to comment.