[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 589
  • Last Modified:

PDFs

Hi all,

Want to exchange your PDF code for 1200 expert points?

What I need is code which can create Adobe PDF (portable document format) files.

The API/component/code needs:
to support A4 and A3,
to support text,
and to support bitmaps.

Reading PDFs is not required.

I know about Distiller and PDFWriter from Adobe, but these are too expensive!

Phil.
0
philipleighs
Asked:
philipleighs
  • 4
  • 4
  • 4
  • +8
1 Solution
 
efgsysCommented:
Have you checked out the Delphi Super Page at http://sunsite.icm.edu.pl/delphi/ yet? That's where I go for free and lowcost components.
0
 
davidmwilliamsCommented:
 I would be very interested to see an answer to your question, too!
  Unfortunately, I suspect there will not be such code available because I do not believe Adobe make available the PDF file format - it is entirely proprietary and protected.
0
 
BoRiSCommented:
philipleighs

here are ll the file formats for thr adobe products, the pdf is here to but it's about 24 pages so I guess I won't post it here...

http://www.adobe.com/supportservice/devrelations/technotes.html

Just download the file formats you looking for...

Later
BoRiS
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
ronit051397Commented:
0
 
ZifNabCommented:
There is a little problem about this. It's format is copyrighted by adobe and I believe they never give it away. I don't think it's possible to get such a writer created. Zif.
0
 
dwwangCommented:
I also think so, you know there's a MSWord plugin that can write PDF file, but requires PDFWriter installed.
0
 
erajojCommented:
Hi Zif,
what the h**l are you talking about? ;-)
The PDF is an open document format, that's the whole idea behind it.
Here are two extracts from the PDF-doc @ http://www.adobe.com/supportservice/devrelations/PDFS/TN/PDFSPEC.TXT (did you read it? ;-):

"This book provides a description of the PDF file format, as well as
suggestions for producing efficient PDF files. It is intended primarily for
application developers who wish to produce PDF files directly. This book
also contains enough information to allow developers to write applications
that read and modify PDF files. While PDF is independent of any particular
application, occasionally PDF features are best explained by the actions a
particular application takes when it encounters that feature in a file."

"This is one of the goals of this book---to make the file format
accessible so that application developers can expand on the ideas behind
PDF and the applications that initially support it."

Since the PDF is based upon the PostScript format and because the PostScript format is a fairly easy version of the stack based language Forth, it should be no big problem creating a component that creates PDF documents. The thing is that supporting ALL features of PDF is a HUUUGE job. To implement drawing text, lines, polygons, beziers, bitmaps in their simplest form isn't. For example, one could convert the contents of a metafile DC to a PDF file fairly easily.
However, if there is a readymade component, who needs the extra work?

And... if you only need to convert a few documents (<20, or <100,000 lines), I can do it for you.
All the documentation used at my workplace is in PDF, so...

/// John
0
 
ZifNabCommented:
erajoj, no I didn't read it. I searched for this a couple of months ago, but I always found that there didn't exist writers of PDF because of the copyright.
0
 
philipleighsAuthor Commented:
Hi all,

I have read the PDF spec from Adobe. What I'm after is not particularly difficult. I only want to create PDFs with simple features. PDF files are basically a text format.

In response:
John,
>>However, if there is a readymade component, who needs the extra work?
Exactly, I'm not really interested in spending time reinventing the wheel. Thanks for the offer to convert files, but the API will become part of some DTP style software I'm writing.

Zif,
The format spec is freely available. There are no royalties required to use the PDF format.

Efgsys,
I've looked on DSP, there are no PDF components.

So in summary:
Now 2000 expert points to anyone who feels inclined to write or provide an API something like this:

CreatePDF(FileName, PaperSize, PaperOrientation);
WriteTextToPDF(Text, Left, Top, Width, Color, FontNumber)
WriteBitmapToPDF(FileName, BoundingRect);
ClosePDF;

Cheers,
Phil.

PS: If you have C/C++ code, I'll convert it to Delphi, and return you a copy if you like.

PS2: By API, I mean API and working implementation of course!
0
 
BlackManCommented:
You might want to check PDFLib (written in ANSI C). Surf to http://www.ifconnection.de/~tm/ and choose 'C' in the menu.
If that's not what you want, I might dig up a URL that can lead you in the right direction, but I guess that most PDF source is written in C, so you'll have to do some conversion...
0
 
ZifNabCommented:
Hi philipleighs,

 If you ever find a solution, can you let me know of it? Thanks!

Zif.
0
 
BigRatCommented:
If you look at the Octobers issue of WEB Techniques (Vol 3 Issue 10) page 61 there is an article by Nassib Nassar on automating PDF Objects. He presents a Java class hierarchy for constructing/analysing PDF files. I managed to download these files, but I can't remember from where (there should be a link from www.webtechniques.com in any case). They should be easily converted to Delphi objects.
      BigRat
0
 
ZifNabCommented:
philip, just one more q'n. PDF files can be generated by just sending it to a printer driver... Isn't this enough? Just make your report and send it to the PDF printer drive. Zif.
0
 
philipleighsAuthor Commented:
Hi Zif,

The only PDF printer driver I know of is PDFWriter. It's not free, here lies the problem.
0
 
BlackManCommented:
Have you checked PDFLib?
0
 
philipleighsAuthor Commented:
Hi BlackMan,

Yes I checked it out. You get the points. Submit an answer.

To everyone in this list who expressed interest in such a component, PdfLib is what you're looking for. It is reasonably esay to wrap up in a DLL if you have DevStudio or something.

You create a PDF file a bit like this:

    p := PDF_open(pdffile, info);
    PDF_begin_page(p, a4.width, a4.height);
    PDF_set_font(p, "Helvetica", 12, winansi);
    PDF_set_text_pos(p, 50, 700);
    PDF_show(p, 'Some text');

    image := PDF_open_JPEG(p, 'picture.jpg');
    PDF_add_outline(p, image.filename);
    PDF_place_image(p, image, 100.0, 200.0, 0.4);
    PDF_close_image(p, image);

    PDF_end_page(p);
    PDF_close(p);

The URL for PDF is in BlackMans first comment.

Cheers,
Phil.

0
 
BlackManCommented:
You might want to check PDFLib (written in ANSI C). Surf to http://www.ifconnection.de/~tm/ and choose 'C' in the menu.
If that's not what you want, I might dig up a URL that can lead you in the right direction, but I guess that most PDF source is written in C, so you'll have to do some conversion
0
 
BlackManCommented:
Glad I could help...
0
 
SnodyCommented:
Do u have converted this c sources into Delphi... I realy need it... Plz send it to me THX
0
 
philipleighsAuthor Commented:
Sorry, I just wrapped it up in a VC dll which I left at my last job!
0
 
SnodyCommented:
Hmm... that's bad... I need it... Thx anyway
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 4
  • 4
  • +8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now