Focal Point
SVG in PDF [SOLVED]

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2877078995

March 08, 2011, 06:32 AM
Marco
SVG in PDF [SOLVED]
Hi all,

First post ever here, so I'm interested how it works:
I'm trying to save a webfocus generated graph and display it in a PDF report. I used the example CAR. This works. However any modifications to my own code results in gibberish:

%PDF-1.4 6 0 obj << /Length 7 0 R >> stream BT /F1 1 Tf ET 0 g /GS1 gs 0 Tc 0 Tw 0 G 0 J 0 j 1 w 10 M []0 d 1 i q 0.40 0 0 0.48 36 432 cm /Im1 Do Q BT /F1 1 Tf 12 0 0 12 18 762 Tm (PAGE )Tj 12 0 0 12 61 762 Tm ( 1)Tj 12 0 0 12 18 726 Tm (COUNTRY)Tj 12 0 0 12 111 726 Tm (SALES)Tj 12 0 0 12 161 726 Tm (RETAIL_COST)Tj 12 0 0 12 254 726 Tm (DEALER_COST)Tj 12 0 0 12 376 726 Tm (MPG)Tj ET 0.00 0.00 0.00 RG 18 720 m 68 720 l S 111 720 m 147 720 l S 161 720 m 240 720 l S 254 720 m 333 720 l S 376 720 m 397 720 l S BT 12 0 0 12 18 702 Tm (ENGLAND)Tj

Any ideas? Regards, Marco

CAR EXAMPLE
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH HOLD AS 'SALES' FORMAT SVG
END
-RUN
GRAPH FILE CAR
SUM RCOST
ACROSS COUNTRY
ON GRAPH HOLD AS 'RCOST' FORMAT SVG
END
-RUN
GRAPH FILE CAR
SUM DCOST
ACROSS COUNTRY
ON GRAPH HOLD AS 'DCOST' FORMAT SVG
END
-RUN
GRAPH FILE CAR
SUM MPG
ACROSS COUNTRY
ON GRAPH HOLD AS 'MPG' FORMAT SVG
END
-RUN
TABLE FILE CAR
SUM SALES RCOST DCOST MPG
BY COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, IMAGE=SALES.SVG, POSITION=(0.50 2.0), SIZE=(4.0 3.0),$
TYPE=REPORT, IMAGE=RCOST.SVG, POSITION=(4.50 2.0), SIZE=(4.0 3.0),$
TYPE=REPORT, IMAGE=DCOST.SVG, POSITION=(0.50 5.0), SIZE=(4.0 3.0),$
TYPE=REPORT, IMAGE=MPG.SVG, POSITION=(4.50 5.0), SIZE=(4.0 3.0),$
ENDSTYLE
END

Solution: structure above works correctly. I build the query from scratch and now i have very sharp SVG'S!

This message has been edited. Last edited by: Marco,


7.7.04 SP04 /Windows
all output
March 08, 2011, 01:10 PM
Francis Mariani
Marco, please elaborate on the modifications you're doing. I would add them one by one your working example until something breaks - have you pinpointed the problem code? Could it be something in the Java that styles the graphs?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 08, 2011, 03:48 PM
Waz
The Gibberish you posted certainly looks like the start to a PDF document.

Is this what you get back with the PCHOLD ?

If so, then this may be a mime issue.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 10, 2011, 09:42 AM
GamP
quote:
This works. However any modifications to my own code results in gibberish
Do you re-run your request, or do you do a refresh of the browser window? I have seen cases where I got this junk when I did a refresh. It never happened after re-running the fex. I see same sort of results when trying to refresh a xml-page in the browser after having changed to code to produce other than xml output.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 11, 2011, 08:40 AM
Marco
Thanks for all the replies. I started to build the query from scratch again and discovered a glitch in my own code. Now I get my graphs in SVG in PDF. So problem solved. Thanks.


7.7.04 SP04 /Windows
all output
March 11, 2011, 03:29 PM
Waz
Please update your first post in the thread and add [SOLVED].

Any extra info on the solution may help others in the future.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!