🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.document.graphics.server
1 messages
1 total messages Started by nuts bout screws Fri, 17 Sep 2004 04:59
Convert Multiple SVG images to pdf
#217
Author: nuts bout screws
Date: Fri, 17 Sep 2004 04:59
57 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads