[jira] [Updated] (FOP-2237) [PATCH]Clicking zoom-in or zoom-out buttons in preview screen should cause NullPointerException

2013-04-17 Thread Peter Orolin (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Orolin updated FOP-2237:
--

Attachment: patch.diff

 [PATCH]Clicking zoom-in or zoom-out buttons in preview screen should cause 
 NullPointerException
 ---

 Key: FOP-2237
 URL: https://issues.apache.org/jira/browse/FOP-2237
 Project: Fop
  Issue Type: Bug
  Components: awt renderer
Affects Versions: trunk
 Environment: Operating System: Windows
 Platform: PC
Reporter: Peter Orolin
  Labels: patch
 Attachments: patch.diff

   Original Estimate: 3h
  Remaining Estimate: 3h

 Zoom in preview screen should cause NullPointerException, because of 
 incorrect use of synchronized in  class 
 org.apache.fop.render.awt.viewer.PreviewPanel. 
 Method PreviewPanel.reload() is synchronized, but it creates new Thread, 
 which is not under synchronized control. Sometimes, when it is later run 
 method PreviewPanel.showPage(), it finishes with NullPointerException (array 
 pagePanels is initialized, but objects in the array not -- see 
 PreviewPanel.ShowPageImage.run statement pagePanels[pg - 
 firstPage].setPage(pg);)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (FOP-2237) [PATCH]Clicking zoom-in or zoom-out buttons in preview screen should cause NullPointerException

2013-04-17 Thread Peter Orolin (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Orolin updated FOP-2237:
--

Attachment: (was: patch.diff)

 [PATCH]Clicking zoom-in or zoom-out buttons in preview screen should cause 
 NullPointerException
 ---

 Key: FOP-2237
 URL: https://issues.apache.org/jira/browse/FOP-2237
 Project: Fop
  Issue Type: Bug
  Components: awt renderer
Affects Versions: trunk
 Environment: Operating System: Windows
 Platform: PC
Reporter: Peter Orolin
  Labels: patch
 Attachments: patch.diff

   Original Estimate: 3h
  Remaining Estimate: 3h

 Zoom in preview screen should cause NullPointerException, because of 
 incorrect use of synchronized in  class 
 org.apache.fop.render.awt.viewer.PreviewPanel. 
 Method PreviewPanel.reload() is synchronized, but it creates new Thread, 
 which is not under synchronized control. Sometimes, when it is later run 
 method PreviewPanel.showPage(), it finishes with NullPointerException (array 
 pagePanels is initialized, but objects in the array not -- see 
 PreviewPanel.ShowPageImage.run statement pagePanels[pg - 
 firstPage].setPage(pg);)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Rendering issue: table with multiple cell spans

2013-04-17 Thread sdridi
Hello,

I'm new to the Apache FOP project and I would like to help fixing this bug 
https://issues.apache.org/jira/browse/FOP-2230
https://issues.apache.org/jira/browse/FOP-2230  . Considering the huge
code base of FOP, I feel kind of lost, so I need some help from people who
are familiar with the code and the rendering pipeline in general. 

So if you can give me some pointers regarding table rendering in FOP, I'd be
very grateful.

Regards

Seifeddine



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Rendering-issue-table-with-multiple-cell-spans-tp38341.html
Sent from the FOP - Dev mailing list archive at Nabble.com.


RE: [OT] Multi-page support in PDFTranscoder

2013-04-17 Thread honyk
 So if I understand well, you are using FOP but not using FO.

Exactly.

 So, why not just use FO to do that?

This was my original approach, but I ran into troubles with memory leaks. It
is described here:
http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/201202.mbox/%
3C00c101ccf39a$08fbe1e0$1af3a5a0$@tosov...@email.cz%3E

Additionally, in case of FO I had to 
- store image streams into temporary files
- generate temporary FO with all images linked


Currently I prefer as efficient conversion as possible. 

I've already deciphered by what class that super.transcode(document, uri,
output) is called - it is Batik's org.apache.batik.transcoder.
SVGAbstractTranscoder.

In meantime I've also found this promising thread:
http://apache-fop.1065347.n5.nabble.com/Generating-a-PDF-by-drawing-to-PDFDo
cumentGraphics2D-td17954.html

Now I investigate it further.

Jan


 -Original Message-
 From: Luis Bernardo [mailto:lmpmberna...@gmail.com]
 Sent: Tuesday, April 16, 2013 12:44 AM
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: [OT] Multi-page support in PDFTranscoder
 
 
 So if I understand well, you are using FOP but not using FO. And you
 want to merge multiple PDF pages which are generated from SVG sources.
 So, why not just use FO to do that? If you look at
 examples/fo/svg/external.fo you will quickly see how to do that.
 
 On 4/11/13 8:48 PM, honyk wrote:
  Dear All,
 
  in my app I generate multipage PDFs from SVG sources. Currently I use
 Fop's
  PDF Transcoder and all individual PDF pages (byte streams) merge
 together
  using PDFBox.
 
  I am considering extending the org.apache.fop.svg.PDFTranscoder class
 to
  enable passing document array into the transcode method and to avoid
 another
  dependency or, better, inefficiency.
 
  protected void transcode(Document[] documents, String uri,
 TranscoderOutput
  output) {
 // my code
  }
 
  But analyzing the code I am not sure if something like this is even
  possible. E.g. this line is completely unclear to me (there is no
 transcode
  method in the AbstractFOPTranscoder):
 
  super.transcode(document, uri, output);
 
  To be honest, I don't understand well how the final PDF file is
 generated
  from input SVG nor the way how to intervene into this process and
 insert a
  page break followed by another page.
 
  Can be transcoder modified this way or it would be too complicated?
 
  Thanks for any hints,
 
  Jan




[jira] [Commented] (FOP-2230) RowSpanning will not effect, if there is not a column with all rows

2013-04-17 Thread Vincent Hennebert (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13634321#comment-13634321
 ] 

Vincent Hennebert commented on FOP-2230:


After a closer look at this example, I'm tempted to say that the result is 
correct. Unexpected maybe, but correct.

Cells 1.1 and 1.3 span 2 rows, but their content is only one line worth, so it 
all fits on the first row. As to cell 2.3, it's spanning rows 2 and 3, so it's 
ok if all its content is put on row 3. So row 2 is there, but it's basically 
empty. It has zero height.

Requiring row 2 to have non-zero height means that we have to add some 
arbitrary whitespace. How much? That clashes with the page layout philosophy 
which is biased towards fitting as much content as possible on a page (for 
example, between two ways of laying out a paragraph, one on 9 lines, one or 10 
lines, the 9-line version will be preferred). Besides, that layout with 
whitespace can be achieved by adding a block containing a non-breaking space 
after 1.1 (which is probably how you made the expected version).

We could impose to put at least some content on every row, but it would be hard 
to define a way that would lead to satisfying results in every situation. For 
example, imagine that instead of the text 2.3 you have a big image. Do you 
really want to have row 3 starting all the way down after that big image?

So we're facing a corner case here. All I can suggest is to re-work the layout 
of the table to avoid that situation...

What do people think?

 RowSpanning will not effect, if there is not a column with all rows
 ---

 Key: FOP-2230
 URL: https://issues.apache.org/jira/browse/FOP-2230
 Project: Fop
  Issue Type: Bug
  Components: pdf
Affects Versions: 1.1
Reporter: Markus Sticker
 Attachments: table_error_expected.pdf, table_error.fo, 
 table_error.pdf, table_error.rtf


 RowSpanning will not effect, if there is not a column with all rows

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: Rendering issue: table with multiple cell spans

2013-04-17 Thread Vincent Hennebert
Hi Seifeddine,

Welcome to FOP!

On 17/04/13 17:00, sdridi wrote:
 Hello,
 
 I'm new to the Apache FOP project and I would like to help fixing this bug 
 https://issues.apache.org/jira/browse/FOP-2230
 https://issues.apache.org/jira/browse/FOP-2230  . Considering the huge
 code base of FOP, I feel kind of lost, so I need some help from people who
 are familiar with the code and the rendering pipeline in general. 
 
 So if you can give me some pointers regarding table rendering in FOP, I'd be
 very grateful.

I’ve just added a comment to that bug. Basically I’m not sure if there’s
anything to fix regarding that particular issue. At any rate, it still
needs to be further discussed I think.

Feel free to add your thoughts to that issue if you have any. Or you may
want to pick another bug that you’d like to fix. This one is probably
a bit daunting if you’re just starting on FOP.


 Regards
 
 Seifeddine

HTH,
Vincent


RE: [OT] Multi-page support in PDFTranscoder

2013-04-17 Thread honyk
Finally I succeed with this code:

http://drifted.in/other/MultiPagePDFTranscoder.java

It is based on a default PDFTranscoder with a simple loop. I suppose there
is a room for additional improvements...

With this code I am getting ca 15% time reduction for two page outputs. Not
much, but I am satisfied :-)

Jan


 -Original Message-
 From: honyk [mailto:j.tosov...@email.cz]
 Sent: Wednesday, April 17, 2013 8:24 PM
 To: fop-dev@xmlgraphics.apache.org
 Subject: RE: [OT] Multi-page support in PDFTranscoder
 
  So if I understand well, you are using FOP but not using FO.
 
 Exactly.
 
  So, why not just use FO to do that?
 
 This was my original approach, but I ran into troubles with memory
 leaks. It
 is described here:
 http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-
 users/201202.mbox/%
 3C00c101ccf39a$08fbe1e0$1af3a5a0$@tosov...@email.cz%3E
 
 Additionally, in case of FO I had to
 - store image streams into temporary files
 - generate temporary FO with all images linked
 
 
 Currently I prefer as efficient conversion as possible.
 
 I've already deciphered by what class that super.transcode(document,
 uri,
 output) is called - it is Batik's org.apache.batik.transcoder.
 SVGAbstractTranscoder.
 
 In meantime I've also found this promising thread:
 http://apache-fop.1065347.n5.nabble.com/Generating-a-PDF-by-drawing-to-
 PDFDo
 cumentGraphics2D-td17954.html
 
 Now I investigate it further.
 
 Jan
 
 
  -Original Message-
  From: Luis Bernardo [mailto:lmpmberna...@gmail.com]
  Sent: Tuesday, April 16, 2013 12:44 AM
  To: fop-dev@xmlgraphics.apache.org
  Subject: Re: [OT] Multi-page support in PDFTranscoder
 
 
  So if I understand well, you are using FOP but not using FO. And you
  want to merge multiple PDF pages which are generated from SVG
 sources.
  So, why not just use FO to do that? If you look at
  examples/fo/svg/external.fo you will quickly see how to do that.
 
  On 4/11/13 8:48 PM, honyk wrote:
   Dear All,
  
   in my app I generate multipage PDFs from SVG sources. Currently I
 use
  Fop's
   PDF Transcoder and all individual PDF pages (byte streams) merge
  together
   using PDFBox.
  
   I am considering extending the org.apache.fop.svg.PDFTranscoder
 class
  to
   enable passing document array into the transcode method and to
 avoid
  another
   dependency or, better, inefficiency.
  
   protected void transcode(Document[] documents, String uri,
  TranscoderOutput
   output) {
  // my code
   }
  
   But analyzing the code I am not sure if something like this is even
   possible. E.g. this line is completely unclear to me (there is no
  transcode
   method in the AbstractFOPTranscoder):
  
   super.transcode(document, uri, output);
  
   To be honest, I don't understand well how the final PDF file is
  generated
   from input SVG nor the way how to intervene into this process and
  insert a
   page break followed by another page.
  
   Can be transcoder modified this way or it would be too complicated?
  
   Thanks for any hints,
  
   Jan