Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Printing database content, or creating a pdf from it

Guest
Feb 18, 2013 Feb 18, 2013

Gidday guys

Today I'm researching using AS3 AIR to format and print data from a database.

It needs to...

- take the data, and format it from a selection of page formats I present

- either print it to the printer, or save it to a pdf

I'm wondering if someone with experience can please nudge me in the right research direction to answer...

- what's the process for taking data and formatting it into an object to be printed of turned into a pdf?

- is the object you make for printing a sprite? ie for multi page printing, do you create multiple sprites that contain your data formatted a particular way, and then create a multipage document out of them.

Cheers for your guidance.

TOPICS
ActionScript
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Feb 18, 2013 Feb 18, 2013

Without having to rely on the user having a PDF-driver installed on her/his machine you will need a library like AlivePDF to let him print out to pdf.

A workflow could be: Retrieving your needed data via php/Flashvars>filling your prepared document Template>using AlivePDF to print out to pdf.

Translate
Community Expert ,
Feb 18, 2013 Feb 18, 2013

for printing, create print page sized sprites or movieclips laid out exactly the way you want your printed page to appear.  i create the printjob, then access its pageHeight and pageWidth properties

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 18, 2013 Feb 18, 2013

Hey kGlad

That's what I was hoping.

But I've been playing with AlivePDF for a couple of hours, and it looks pretty powerful.

Have you had experience with it, and if so, what would be a couple of reasons you'd go with either the way you mentioned in your post, or AlivePDF?

Thanks mate.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 19, 2013 Feb 19, 2013

yes, i tried to use alivePDF for something a few years ago and found that it could not do what i wanted.  i can't remember what that was but there are definite limitations.

whereas the print method i sketeched allows pixel-perfect creation of what you want printed.

p.s. you can assume the user has a pdf viewing capability or you probably shouldn't be using alivePDF.  what will they do with the pdfs?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 26, 2013 Feb 26, 2013

OK - I've avoided AlivePDF, and used printJob after a flowComposer has compiled the pages to be printed from a loop. I'll leave it up to the user if they print to paper, or to pdf using thier own pdf converter.

Thanks kGlad

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2013 Feb 26, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 18, 2013 Feb 18, 2013

Without having to rely on the user having a PDF-driver installed on her/his machine you will need a library like AlivePDF to let him print out to pdf.

A workflow could be: Retrieving your needed data via php/Flashvars>filling your prepared document Template>using AlivePDF to print out to pdf.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 18, 2013 Feb 18, 2013

I forgot to mention is for a desktop AIR app.

So rather than use the AlivePDF api for creating the layout etc, do that myself, and then just send the result to AlivePDF?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 19, 2013 Feb 19, 2013

No that won`t work. AlivePDF uses its own method of embedding fonts (if I remmeber correct you can only use ttf not otf font formats). AlivePDF is not exactly well documented or much used. Its technics are a little "arcane". It was created by the same Guy whose brainchild was Stage3D so you can imagine how complex it is for us mere mortals. A good start is this little blog .

I also can see why Adobe (who is his boss) isn`t exactly highly motivated to make AlivePDF too much of a Acrobat Double 😉

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 19, 2013 Feb 19, 2013

Arcane is an apt word!!!

The API at Adobe doesn't always match with the class methods - I had to look at the flex page that comes with the source files to figure out the correct number and order or arguments. Plus, when you look through blog and forum posts, their info is useless unless you can figure which API version they refer to.

I might stick with it for a few more hours to see if I can tweek it to what I need - it's seems pretty powerful, but yeah - very vague and mostly non existent docs.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines