xsl-fo

How to make an image a “hotspot” using fo:basic-link

浪尽此生 提交于 2019-12-23 22:30:46
问题 I am using below code for wrapping image under basic-link <xsl:template name="bottomSection"> <fo:block> <fo:basic-link color="blue" external-destination="http://www.google.com"> <fo:external-graphic src="url('E:/images/promoAdd.jpg')"/> </fo:basic-link> </fo:block> </xsl:template> Now, in the resulting pdf, only the very bottom edge of the image has hyperlink (it appears only when cursor is moved at the bottom of the image). I need to display this hyperlink when cursor is moved to any part

Placing letters under underlined text in XSL-FO using Apache FOP

左心房为你撑大大i 提交于 2019-12-23 21:27:00
问题 I have a project that requires me to place a ID string under some underlined text in a passage of text. Here is an example using an inline SVG object with a gray border to show the layout: I can get close using an inline element with a baseline-shift and then use SVG to render the text. However this has the disadvantage (I think) that I have to manually put in the width of the SVG in pixels, which seems very complicated for such a simple layout. Here is the XSL-FO markup for this: <fo:block>

Generating PDF from XML in Java using ApacheFOP

心已入冬 提交于 2019-12-23 12:45:15
问题 I am trying to generate on-the-fly PDF reports from Java objects. I have not been able to find many examples of this, so I have been following this example: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup The only real difference between this code and my own is that I generate src (line 81 in the example) using JSON conversion and an XMLSerializer. The problem I run into is using the Transformer. When I do the transform

What does reference-orientation really do?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 09:49:05
问题 I have to render a pfd using FOP, and some images mst be rotated. The result however doesn't look the way I expect it to be. So, here is my question (and I somehow wasn't able to find a good documentation to clarify this issue for me): If I define fo:block-container reference-orientation="90" width="100" height="200" will this rotate the whole container (leading effectively to a rendered box of dimension 200x100), or will it merely rotate the content of the container (leaving the container

Return as ByteArrayOutputStream instead of FileOutputStream

◇◆丶佛笑我妖孽 提交于 2019-12-23 06:37:26
问题 I have a requirement to generate PDF file from JSON Objects and am able to produce PDF document using Apache FOP and Java. But i want to return the PDF file as ByteArrayOutputStream and then i have to encode like this Base64.getEncoder().encodeToString(baos.toByteArray()) . Please find the below code where am able to generate PDF file, instead of FileOutputStream i want to return as ByteArrayOutputStream . ByteArrayOutputStream outStream = new ByteArrayOutputStream(); Transformer

fo:instream-foreign-object does not show the image properly

扶醉桌前 提交于 2019-12-23 05:07:43
问题 I use the below code to show a PNG image in PDF. I use <fo:instream-foreign-object> because <fo:external-graphic> does not fulfil my requirement to show a image. Refer to issue external graphic <fo:instream-foreign-object width="50%" content-width="scale-to-fit"> <svg> <image height="439px" width="1037px" xlink:href="test.png"/> </svg> </fo:instream-foreign-object> With the above use, I am not able to get the picture in the document. The image is not properly placed in the page and the text

How can I make text automatically scale down in an SVG?

谁都会走 提交于 2019-12-23 02:55:17
问题 I've got an SVG element that I've created with Inkscape. I then take that SVG and put in as part of an XSL-FO stylesheet that is used to transform XML data and then passed through the IBEX renderer to create a pdf (which is usually then printed). As an example, I have elements in the svg/stylesheet that look like this (extra noise due to the Inkscape export): <text x="114" x="278.36218" id="id1" xml:space="preserve" style="big-long-style-string-from-inkscape"> <tspan x="114" y="278.36218" id=

How can I convert docx or wordml xml files to xsl-fo?

泄露秘密 提交于 2019-12-22 14:47:26
问题 I've been looking for a method to convert docx or wordml xml to xsl-fo. I read this post: What is the best XSLT engine for Perl? but I'm having exceptional problems getting apache-fop going. I was able to download the bins and run it locally but the formatting was a little off and it didn't maintain the headers and footers or section 1 or section 3 (17 page doc 3 sections). It also overlapped the text over the outline numbers and did not maintain the font used. Trying a more simple test

XSL-FO Different header/footer depending on page-position

坚强是说给别人听的谎言 提交于 2019-12-22 12:25:36
问题 This might be a quite common problem with XSL-FO: I try to build a billing which has clear specifications: "Main Header": on every page (Text, Logo and Barcode) "Sub Header": (Customer Data) -> On the first page this block should be about 10% of the pages height -> On all the others page this block should be about the half smaller, so lets say 5% "Last-Page Footer": just on the last page of course (Total amount and signatures) "Every-page Footer": just for the printing date "Body": the

XSL-FO compared to classical technologies

浪尽此生 提交于 2019-12-22 10:28:20
问题 I have recently started to experiment with XSL-FO; It seems well supported, all XSL-FO vendors are very helpful, and you can start with little (or no) money. My company bought a heavy duty (40k pages per minute) IBM printer back in the 90's but its software is now quite obsolete. XSL-FO looks promising, but I am wondering if older, well established technologies may be better. The Chief Architect of ISIS Papyrus which builds such software, believes that XSL-FO is just a marketing pitch. 回答1: