Article View: adobe.document.graphics.server
Article #217Convert Multiple SVG images to pdf
From: nuts bout screws
Date: Fri, 17 Sep 2004 04:59
Date: Fri, 17 Sep 2004 04:59
57 lines
2601 bytes
2601 bytes
G'Day Guys,
We have a problem trying to convert our svg to pdf. We consistently
have svg with height of more than 11.5in, standard height of an A4
paper. Problem we are facing is when printing, the printer only prints
one page, chopping off the bottom section.
After reading the documentation, we realised that AGS considers the
top svg element node of the SVG image as one page. We are now
considering of chopping our svg image into multiple SVG image, each of
height 11.5in. We will then feed them SVG images to AGS which will
create a pdf. This pdf will have the original SVG, chopped into
multiple pages of height 11.5in.
As a proof of concept, we tried to load 3 SVG images into AGS but
without luck.
Heres a snippet of our code:
svgContent = Session("graphic") '//SVG
set agsServer = server.CreateObject("AlterCastCOM.ACServer")
set agsRequest = server.CreateObject("AlterCastCOM.ACRequest")
commands = "<commands>"
'// loading multiple SVG images
for i=1 to 3
commands = commands & "<loadContent source=""web" & i & ".svg""/>"
next
commands = commands & "<convertSVGToPDF pageSize=""8.5in,11in""/>"
commands = commands & "<saveContent name=""web""
appendExtension=""true"" /></commands>"
agsRequest.setCommands(commands)
for i=1 to 3
agsRequest.addString "web" & i & ".svg",svgContent
next
set agsResponse = agsServer.execute(agsRequest)
set dataset = agsResponse.getData()
set firstResult = dataset.Item(1)
outFileName = firstResult.getname()
outMimeType = firstResult.gettype()
Response.AddHeader "Title", "FEWD Log Print"
Response.ContentType = outMimeType
'// stream out the pdf
Response.BinaryWrite firstResult.GetData
I get a pdf, but I only get one svg image and only one page. How come
this code doesn't do what i want ?
Cheers
Abhishek Mishra
Technical Details
Message-ID:
<927e385a.0409162059.44ce9eb0@posting.google.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1effe5,261fcc21bdcb493b,start X-Google-Attributes: gid1effe5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail From: abhim@visean.com (nuts bout screws) Newsgroups: adobe.document.graphics.server Subject: Convert Multiple SVG images to pdf Date: 16 Sep 2004 21:59:48 -0700 Organization: http://groups.google.com Lines: 57 Message-ID: <927e385a.0409162059.44ce9eb0@posting.google.com> NNTP-Posting-Host: 220.240.82.224 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095397189 9156 127.0.0.1 (17 Sep 2004 04:59:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Sep 2004 04:59:49 +0000 (UTC)