@Override public InputStream supply() { byte[] font1 = ctx.getUserAgentCallback().getBinaryResource(src); if (font1 == null) { XRLog.exception("Could not load @font-face font: " + src); return null; } return new ByteArrayInputStream(font1); } }
private Document loadDocument(String uri) { return _sharedContext.getUserAgentCallback().getXMLResource(uri).getDocument(); }
/** * Gets the baseURL attribute of the RenderingContext object * * @return The baseURL value */ public String getBaseURL() { return uac.getBaseURL(); }
return new PdfBoxSVGReplacedElement(uac.getXMLResource(srcAttr).getDocument().getDocumentElement(), _svgImpl, cssWidth, cssHeight, box, c, c.getSharedContext()); FSImage fsImage = uac.getImageResource(srcAttr).getImage(); if (fsImage != null) { boolean hasMaxHeight = !box.getStyle().isMaxHeightNone();
private FSImage getBackgroundImage(RenderingContext c, CalculatedStyle style) { if (! style.isIdent(CSSName.BACKGROUND_IMAGE, IdentValue.NONE)) { String uri = style.getStringProperty(CSSName.BACKGROUND_IMAGE); try { return c.getUac().getImageResource(uri).getImage(); } catch (Exception ex) { ex.printStackTrace(); Uu.p(ex); } } return null; }
uri = _uac.resolveURI(ref.getUri()); ref.setUri(uri); } else { ref.setUri(_uac.getBaseURL() + "#inline_style_" + (++inlineStyleCount)); Stylesheet sheet = _stylesheetFactory.parse( new StringReader(ref.getContent()), ref);
String url = ctx.getUac().resolveURI(pdfsrc);
String uriResolved = ThreadCtx.get().sharedContext().getUserAgentCallback().resolveUri(_URI, uriResult);
/** * Sets the baseURL attribute of the RenderingContext object * * @param url The new baseURL value */ public void setBaseURL(String url) { uac.setBaseURL(url); }
/** * Gets the visited attribute of the StandardAttributeResolver object * * @param e PARAM * @return The visited value */ public boolean isVisited(Object e) { return isLink(e) && uac.isVisited(nsh.getLinkUri((Element) e)); }
/** * @return Returns null if uri could not be loaded */ private Stylesheet parse(StylesheetInfo info) { CSSResource cr = _userAgentCallback.getCSSResource(info.getUri()); if (cr == null) { return null; } Reader reader = cr.getResourceReader(); if (reader == null) { return null; } try { return parse(reader, info); } finally { try { reader.close(); } catch (IOException e) { // ignore } } }
return new PdfBoxSVGReplacedElement(uac.getXMLResource(srcAttr).getDocument().getDocumentElement(), _svgImpl, cssWidth, cssHeight, box, c, c.getSharedContext()); FSImage fsImage = uac.getImageResource(srcAttr).getImage(); if (fsImage != null) { boolean hasMaxHeight = !box.getStyle().isMaxHeightNone();
FSImage fsImage = getUserAgentCallback().getImageResource(getAttribute("src")).getImage();
String ruri = uac.resolveURI(imageSrc);
String baseUri = stylesheet.getURI(); String resolved = ThreadCtx.get().sharedContext().getUserAgentCallback().resolveUri(baseUri, uri);
byte[] font1 = _sharedCtx.getUserAgentCallback().getBinaryResource(src); if (font1 == null) { XRLog.exception("Could not load font " + src);
private MarkerData.ImageMarker makeImageMarker( LayoutContext c, StrutMetrics structMetrics, String image) { FSImage img = null; if (! image.equals("none")) { img = c.getUac().getImageResource(image).getImage(); if (img != null) { StrutMetrics strutMetrics = structMetrics; if (img.getHeight() > strutMetrics.getAscent()) { img.scale(-1, (int) strutMetrics.getAscent()); } MarkerData.ImageMarker result = new MarkerData.ImageMarker(); result.setImage(img); result.setLayoutWidth(img.getWidth() * 2); return result; } } return null; }
private Document loadDocument(String uri) { return _sharedContext.getUserAgentCallback().getXMLResource(uri).getDocument(); }
/** * Flushes any stylesheet associated with this stylereference (based on the user agent callback) that are in cache. * Deprecated for now, until we fix caching, use a new <code>StylesheetFactory</code> each run. */ @Deprecated public void flushStyleSheets() { String uri = _uac.getBaseURL(); StylesheetInfo info = new StylesheetInfo(); info.setUri(uri); info.setOrigin(StylesheetInfo.AUTHOR); if (_stylesheetFactory.containsStylesheet(uri)) { _stylesheetFactory.removeCachedStylesheet(uri); XRLog.cssParse("Removing stylesheet '" + uri + "' from cache by request."); } else { XRLog.cssParse("Requested removing stylesheet '" + uri + "', but it's not in cache."); } }
byte[] font1 = _sharedCtx.getUserAgentCallback().getBinaryResource(src); if (font1 == null) { XRLog.exception("Could not load font " + src);