Error in PDF file
I am trying to create a simple PDF document. It consists of three pages or simple 2D graphics. I am using the PDFRenderer to create the pages. I create an SVG document from the SVGGraphics2D object. Then create a SVGArea with the SVGDocument. Thie area is then added to the Page's BodyAreaContainer's mainReferenceArea. Thie creates a PDF file that looks like it is large enough with all the pictures. When I open the file in Acrobat reader, I get an error saying Illegal operation 'q' inside a text object And the pages are blank. Why ?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error in PDF file
Ethan, I suspect there's a problem in your XSL-FO file. I had similar things happen to me with fo:list-item, and one of the components turned out to be empty. This caused an error in the renderer. I processed my XML XSL-FO using XALAN.BAT (included with 0.20.5rc), but set my output to -fo. the command line would be (assume c:\java\fop-0.20.5rc is command prompt): c:\java\fop-0.20.5rcxalan.bat -in c:\path\to\your\xmlfile.xml -xsl c:\path\to\your\xslfile.xsl -out c:\path\to\your\outputfofile.fo Hope this helps! Web Maestro Clay (note to FOP-DEV: it'd be nice to add a -fo output option to FOP, for debugging--although xalan.bat does this, it'd be nice not have to learn one more thing ;-p) Leet, Ethan C wrote: I am trying to create a simple PDF document. It consists of three pages or simple 2D graphics. I am using the PDFRenderer to create the pages. I create an SVG document from the SVGGraphics2D object. Then create a SVGArea with the SVGDocument. Thie area is then added to the Page's BodyAreaContainer's mainReferenceArea. Thie creates a PDF file that looks like it is large enough with all the pictures. When I open the file in Acrobat reader, I get an error saying Illegal operation 'q' inside a text object And the pages are blank. Why ?? -- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error in PDF file
Clay Leeds wrote: (note to FOP-DEV: it'd be nice to add a -fo output option to FOP, for debugging--although xalan.bat does this, it'd be nice not have to learn one more thing ;-p) I suspect the reason why we didn't go that route is that -fo is already used as an /input/ option. The only way you could make this work is to treat -fo differently depending on whether -xml is present. That seems confusing and risky, since a user might accidentally overwrite a valuable fo file this way. I think it is better to keep the two processes separate. Victor Mote - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error in PDF file
Allow me to clarify what I said. Sorry for the re-post... My problem was in fo:list-block: fo:list-block space-before=6pt space-after=6pt font-family=Times fo:list-item fo:list-item-label end-indent=label-end() fo:block font-family=ZapfDingbats?/fo:block /fo:list-item-label fo:list-item-body start-indent=body-start() fo:block This is the first entry in a plain unordered list. A check symbol is displayed in the bullet. /fo:block /fo:list-item-body /fo:list-item fo:list-item fo:list-item-label end-indent=label-end() fo:block font-family=ZapfDingbats?/fo:block /fo:list-item-label fo:list-item-body start-indent=body-start() fo:block/fo:block /fo:list-item-body /fo:list-item /fo:list-block I was missing content in 2nd fo:list-item-bodyfo:block. The PDF file rendered normally (I think FOP returned a warning), but an error was given when the file was opened in Adobe Acrobat Reader. Unbeknownst to me, my XML file did not include data where it was expected. What did I do? I wrote this list and they recommended I output the FO file using XALAN.BAT, and look for the problem. I found the problem by searching all of the fo:list-block items... Clay Leeds wrote: Ethan, I suspect there's a problem in your XSL-FO file. I had similar things happen to me with fo:list-item, and one of the components turned out to be empty. This caused an error in the renderer. I processed my XML XSL-FO using XALAN.BAT (included with 0.20.5rc), but set my output to -fo. the command line would be (assume c:\java\fop-0.20.5rc is command prompt): c:\java\fop-0.20.5rcxalan.bat -in c:\path\to\your\xmlfile.xml -xsl c:\path\to\your\xslfile.xsl -out c:\path\to\your\outputfofile.fo Hope this helps! Web Maestro Clay (note to FOP-DEV: it'd be nice to add a -fo output option to FOP, for debugging--although xalan.bat does this, it'd be nice not have to learn one more thing ;-p) -- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error in PDF file
//lcBody.getMainReferenceArea().addChildAtStart(lcSvgArea); // adds invalid q //lcBody.getMainReferenceArea().addChild(lcSvgArea); // adds invalid q //lcBody.addChild(lcSvgArea); // does nothing lcAreaTree.addPage(lcCurPage); } lcStrRenderer.stopRenderer(); lcFileOut.close(); } catch(Exception e) { lcLog.LogWarning(ERROR: +e); throw new PrintException(e); } } This will create an invlaid PDF file that will popup an error saying Illegal 'q' in text object ?? -Original Message- From: Clay Leeds [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2003 1:22 PM To: [EMAIL PROTECTED] Subject: Re: Error in PDF file Allow me to clarify what I said. Sorry for the re-post... My problem was in fo:list-block: fo:list-block space-before=6pt space-after=6pt font-family=Times fo:list-item fo:list-item-label end-indent=label-end() fo:block font-family=ZapfDingbats?/fo:block /fo:list-item-label fo:list-item-body start-indent=body-start() fo:block This is the first entry in a plain unordered list. A check symbol is displayed in the bullet. /fo:block /fo:list-item-body /fo:list-item fo:list-item fo:list-item-label end-indent=label-end() fo:block font-family=ZapfDingbats?/fo:block /fo:list-item-label fo:list-item-body start-indent=body-start() fo:block/fo:block /fo:list-item-body /fo:list-item /fo:list-block I was missing content in 2nd fo:list-item-bodyfo:block. The PDF file rendered normally (I think FOP returned a warning), but an error was given when the file was opened in Adobe Acrobat Reader. Unbeknownst to me, my XML file did not include data where it was expected. What did I do? I wrote this list and they recommended I output the FO file using XALAN.BAT, and look for the problem. I found the problem by searching all of the fo:list-block items... Clay Leeds wrote: Ethan, I suspect there's a problem in your XSL-FO file. I had similar things happen to me with fo:list-item, and one of the components turned out to be empty. This caused an error in the renderer. I processed my XML XSL-FO using XALAN.BAT (included with 0.20.5rc), but set my output to -fo. the command line would be (assume c:\java\fop-0.20.5rc is command prompt): c:\java\fop-0.20.5rcxalan.bat -in c:\path\to\your\xmlfile.xml -xsl c:\path\to\your\xslfile.xsl -out c:\path\to\your\outputfofile.fo Hope this helps! Web Maestro Clay (note to FOP-DEV: it'd be nice to add a -fo output option to FOP, for debugging--although xalan.bat does this, it'd be nice not have to learn one more thing ;-p) -- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error in PDF file
Ethan, I snipped a bit, but found this in your code. Notice the three lines of code which adds invalid q. I don't suppose removing these three lines of code will fix your problem? Otherwise, I can't help. I'm a doctor, not a... er... never mind... Good luck! Leet, Ethan C wrote: // Create a Page with the PageMaster Page lcCurPage = lcPageMaster.makePage(lcAreaTree); //lcCurPage.getBody().addChild(lcSvgArea); // does nothing lcCurPage.getBody().getMainReferenceArea().addChild(lcSvgArea);// adds invalid q //lcCurPage.getBody().addChild(lcSvgArea); // does nothing //lcBody.getMainReferenceArea().addChildAtStart(lcSvgArea); // adds invalid q //lcBody.getMainReferenceArea().addChild(lcSvgArea); // adds invalid q //lcBody.addChild(lcSvgArea); // does nothing lcAreaTree.addPage(lcCurPage); } This will create an invlaid PDF file that will popup an error saying Illegal 'q' in text object -- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error in PDF file
lcCurPage.getBody().getMainReferenceArea().addChild(lcSvgArea); This line is the line that causes the problem. the // adds invalid q is a note to myself for which lines I have tried, and their result. If I remove the line, I can open the document with no errors, but also no data :-( Thank you. I hopefully will crack this soon :-) -Original Message- From: Clay Leeds [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2003 2:18 PM To: [EMAIL PROTECTED] Subject: Re: Error in PDF file Ethan, I snipped a bit, but found this in your code. Notice the three lines of code which adds invalid q. I don't suppose removing these three lines of code will fix your problem? Otherwise, I can't help. I'm a doctor, not a... er... never mind... Good luck! Leet, Ethan C wrote: // Create a Page with the PageMaster Page lcCurPage = lcPageMaster.makePage(lcAreaTree); //lcCurPage.getBody().addChild(lcSvgArea); // does nothing lcCurPage.getBody().getMainReferenceArea().addChild(lcSvgArea);// adds invalid q //lcCurPage.getBody().addChild(lcSvgArea); // does nothing //lcBody.getMainReferenceArea().addChildAtStart(lcSvgArea); // adds invalid q //lcBody.getMainReferenceArea().addChild(lcSvgArea); // adds invalid q //lcBody.addChild(lcSvgArea); // does nothing lcAreaTree.addPage(lcCurPage); } This will create an invlaid PDF file that will popup an error saying Illegal 'q' in text object -- Clay Leeds - [EMAIL PROTECTED] Web Developer - Medata, Inc. - http://www.medata.com PGP Public Key: https://mail.medata.com/pgp/cleeds.asc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]