Ok Checked the deletion code, it doesnt appear to be that , I stopped that part happening but the pdf is still ending up corrupt for adobe and Foxit (but still valid with no errors on Sumatra PDF)
Kindest regards Theresa Forster Senior Software Developer -----Original Message----- From: Theresa Jayne Forster [mailto:[email protected]] Sent: 03 February 2012 14:06 To: [email protected] Subject: RE: Problem that could lose me my job Ok I have put the complete log for the generation on a gist as it is Waaaaay to big to post here https://gist.github.com/1730300 I will check the code I have that sends the pdf to the client then check it is flushing and completing before deleting the file to prevent clutter Maybe I need to change my fileisreadystrategy Thanks for the heads up there at least it gives me somewhere to look. Kindest regards Theresa Forster Senior Software Developer -----Original Message----- From: mehdi houshmand [mailto:[email protected]] Sent: 03 February 2012 13:51 To: [email protected] Subject: Re: Problem that could lose me my job Hi Theresa, The PDF you put up isn't complete, it's as if FOP stopped creating the document for some reason. Was an exception thrown? Would there be any reason why FOP wouldn't finish writing to file? If so, I'd suggest you try FOP trunk as well to see if the same problem arises, if so, then the stacktrace should give an indication as to what is causing the problem. Mehdi On 3 February 2012 13:32, Theresa Jayne Forster <[email protected]> wrote: > Why would that make the output PDF invalid to Adobe and not to Sumatra pdf? > > > > > > Kindest regards > > > > > Theresa Forster > > Senior Software Developer > > From: David J. B. Hollis [mailto:[email protected]] > Sent: 03 February 2012 13:19 > To: [email protected] > Subject: Re: Problem that could lose me my job > > > > Hi, > > > > I've just opened the FO file in oXygen, and it throws up a number of errors: > > > > @ margin-top not allowed in fo:region-start > > @ z-index not allowed in fo:region-body > > @ z-index not allowed in fo:region-before > > @ z-index not allowed in fo:region-after > > > > ... about 20 or so in the fo:simple-page-master section > > > > HTH > > David > > > > > > > > > > Sorry, I was under pressure to roll back the servers that we had just > upgraded to use the fop 1.0 system. > > One of the failing PDFs is at http://www.inbrand1.co.uk/failsinadobe.pdf > > The FO that generated it is at http://www.inbrand1.co.uk/failsinadobe.fo > > > > The fopconfig has nothing except font configurations in it. A couple have > kerning xml files as they produce incorrectly without. > > > > The routine that produces the PDF is as follows > > > > public File generatePDFromFO(File foFile) { > > OutputStream ot = null; > > BufferedOutputStream out = null; > > File tempFile = null; > > try { > > tempFile = File.createTempFile("W2P", ".pdf"); > > out = new BufferedOutputStream( new FileOutputStream(tempFile)); > > fopFactory.setStrictValidation(false); > > DefaultConfigurationBuilder cfgBuilder = new > DefaultConfigurationBuilder(); > > Configuration cfg = cfgBuilder.buildFromFile(new > File("/fopconfig.xml")); > > fopFactory.setUserConfig(cfg); > > FOUserAgent useragent= fopFactory.newFOUserAgent(); > > useragent.setTargetResolution(300); > > Fop fop = > fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); > > TransformerFactory factory = TransformerFactory.newInstance(); > > Source src = new StreamSource(foFile); > > Transformer transformer = factory.newTransformer(); > > Result res = new SAXResult(fop.getDefaultHandler()); > > transformer.transform(src, res); > > } catch (IOException ioe) { > > LOGGER.error("IOException ",ioe); > > ioe.printStackTrace(); > > } catch (SAXException se) { > > LOGGER.error("Sax Exception ",se); > > se.printStackTrace(); > > } catch (ConfigurationException ce) { > > LOGGER.error("Configuration Exception ",ce); > > ce.printStackTrace(); > > } catch (TransformerConfigurationException tce) { > > LOGGER.error("Transformer Configuration Exception",tce); > > tce.printStackTrace(); > > } catch (TransformerException te) { > > LOGGER.error("Transformer Exception ",te); > > te.printStackTrace(); > > } > > return tempFile; > > } > > > > > > Fop config file here > > > > <fop xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > <strict-configuration>true</strict-configuration> > > <base>C:\preprocessor\filestore\</base> > > > > <font-base>/Fonts</font-base> > > > > <cache-file>/fop-cache</cache-file> > > <!-- > > ************************************************************************ > > Add fonts here > > ************************************************************************ > > --> > > <renderers> > > <renderer mime="application/pdf"> > > <fonts> > > <font > embed-url="FRUTL___.TTF" kerning="yes" metrics-url="FrutigerLight.xml"> > > > <font-triplet name="Frutiger" style="normal" weight="200"/> > > > </font> > > <font > embed-url="FRUTB___.TTF" kerning="yes"> > > > <font-triplet name="Frutiger" style="normal" weight="400"/> > > > </font> > > <font > embed-url="tfarrow-medium.TTF"> > > > <font-triplet name="TFArrow" style="normal" weight="400"/> > > > </font> > > <font > embed-url="HELVNBL_.TTF"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="900"/> > > > </font> > > <font > embed-url="helveticaneue_85hv.ttf"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="800"/> > > > </font> > > <font > embed-url="HELVNBI_.TTF"> > > > <font-triplet name="HelveticaNeue" style="italic" weight="700"/> > > > </font> > > <font > embed-url="HELVNM__.TTF"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="500"/> > > > </font> > > <font > embed-url="HELVNI__.TTF"> > > > <font-triplet name="HelveticaNeue" style="italic" weight="400"/> > > > </font> > > <font > embed-url="lte50259.ttf"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="400"/> > > > <font-triplet name="HelveticaNeue" style="roman" weight="400"/> > > > </font> > > <font > embed-url="HELVNL__.TTF"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="300"/> > > > </font> > > <font > embed-url="HELVNT__.TTF" kerning="yes" metrics-url="HelveticaNeueLight.xml"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="200"/> > > > </font> > > <font > embed-url="HELVNUL_.TTF"> > > > <font-triplet name="HelveticaNeue" style="normal" weight="100"/> > > > </font> > > <font > embed-url="LTe50872.ttf"> > > > <font-triplet name="HelveticaNeueCond" style="normal" weight="400"/> > > </font> > > <font > embed-url="LTe50874.ttf"> > > > <font-triplet name="HelveticaNeueCond" style="normal" weight="700"/> > > > </font> > > </fonts> > > </renderer> > > <renderer mime="image/png"> > > > <transparent-page-background>true</transparent-page-background> > > <fonts><auto-detect/></fonts> > > </renderer> > > </renderers> > > </fop> > > > > Kindest regards > > > > > Theresa Forster > > Senior Software Developer > > >
