Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Adding Charts as Images into PDF

Avatar

Avatar
Boost 1
Level 4
aoatak
Level 4

Like

1 like

Total Posts

105 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 4
aoatak
Level 4

Like

1 like

Total Posts

105 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
aoatak
Level 4

13-05-2008

Hi,

Is it possible to add charts(Coldfusion generated charts as images) into a PDF dynamically at runtime using Assembler service? If ıt is possible then can anybody provide a sample of DDX file to use?

And lastly in what other ways I can try to accomplish this task?

Thanks

Replies

Avatar

15-09-2008

1) Assembler can add the chart image file as a file attachment - either attached to the document as a whole, or to a specific page.



<?xml version="1.0" encoding="UTF-8"?>

<DDX xmlns="http://ns.adobe.com/DDX/1.0/">



  <PDF result="outDoc.pdf" >

    <PDF source="inDoc.pdf"/>

    <FileAttachments source="chart.jpg" nameKey="Chart">

      <File filename="chart.jpg" mimetype="image/jpeg"/>

      <FilenameEncoding encoding="UTF-8" />

      <Description>Chart from ColdFusion</Description>

    </FileAttachments>

  </PDF>



</DDX>



2) If PDF Generations service is available, then the image can be converted to a PDF and then any of the pagecontent elements can be used to place the image within the PDF:



<?xml version="1.0" encoding="UTF-8"?>

<DDX xmlns="http://ns.adobe.com/DDX/1.0/">



  <PDF result="outDoc.pdf" >

    <PDF source="inDoc.pdf"/>

    <BlankPage>

      <PageOverlay>

        <PDF source="chart.pdf"/>

      </PageOverlay>

    </BlankPage>

  </PDF>



</DDX>



Note: in the most recent release, LC ES Update 1, if the source idp.document mapped to chart.pdf for the <PDF> element is not a PDF document, Assembler will attempt to call the PDFG service to convert the document to a PDF before throwing an exception. Although, I would probably change the extension of the filename to be indicative of the type of incoming content, e.g. chart.jpg or chart.gif...