Solved

PDFs

Posted on 1998-11-01
21
578 Views
Last Modified: 2013-12-02
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
Comment
Question by:philipleighs
  • 4
  • 4
  • 4
  • +8
21 Comments
 

Expert Comment

by:efgsys
ID: 1345356
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
 
LVL 4

Expert Comment

by:davidmwilliams
ID: 1345357
 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
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345358
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
 
LVL 5

Expert Comment

by:ronit051397
ID: 1345359
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1345360
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
 
LVL 4

Expert Comment

by:dwwang
ID: 1345361
I also think so, you know there's a MSWord plugin that can write PDF file, but requires PDFWriter installed.
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1345362
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1345363
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
 
LVL 3

Author Comment

by:philipleighs
ID: 1345364
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
 
LVL 7

Expert Comment

by:BlackMan
ID: 1345365
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1345366
Hi philipleighs,

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

Zif.
0
 
LVL 27

Expert Comment

by:BigRat
ID: 1345367
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1345368
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
 
LVL 3

Author Comment

by:philipleighs
ID: 1345369
Hi Zif,

The only PDF printer driver I know of is PDFWriter. It's not free, here lies the problem.
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1345370
Have you checked PDFLib?
0
 
LVL 3

Author Comment

by:philipleighs
ID: 1345371
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
 
LVL 7

Accepted Solution

by:
BlackMan earned 500 total points
ID: 1345372
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
 
LVL 7

Expert Comment

by:BlackMan
ID: 1345373
Glad I could help...
0
 

Expert Comment

by:Snody
ID: 2495473
Do u have converted this c sources into Delphi... I realy need it... Plz send it to me THX
0
 
LVL 3

Author Comment

by:philipleighs
ID: 2497659
Sorry, I just wrapped it up in a VC dll which I left at my last job!
0
 

Expert Comment

by:Snody
ID: 2499018
Hmm... that's bad... I need it... Thx anyway
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now