Looking for Erlang code that handles PDF file attachments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for Erlang code that handles PDF file attachments

bengt
Greetings,

I would like to attach files (or some sort of binary content, anyway) to PDF files, without destroying the PDF'ness of the file. I would also like to be able to read the created PDF file and be able to tell what is the attachment (and what is the original content). I have found Itext (Java, see http://itextpdf.com/). It seems to be able to do that and everything else too, but is there any other alternative? Preferably in Erlang.


bengt

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

Chandru-4
Have you looked into erlguten? 


cheers,
Chandru

On 25 January 2017 at 21:06, bengt <[hidden email]> wrote:
Greetings,

I would like to attach files (or some sort of binary content, anyway) to PDF files, without destroying the PDF'ness of the file. I would also like to be able to read the created PDF file and be able to tell what is the attachment (and what is the original content). I have found Itext (Java, see http://itextpdf.com/). It seems to be able to do that and everything else too, but is there any other alternative? Preferably in Erlang.


bengt

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

Joe Armstrong-2
In reply to this post by bengt
I did exactly this a while back.

The enclosed PDF has an erlang program packed inside it.
The erlang program can be used to pack and unpack things inside PDF.

PDF is after all, just a container format (like a zip file)

Hint take a look at the end of erlpdf.pdf in a text editor.

Actually since I always want to read the documentation first - I thought the
code should be *inside* the documentation and NOT the other way around.

Cheers

/Joe


On Wed, Jan 25, 2017 at 10:06 PM, bengt <[hidden email]> wrote:

> Greetings,
>
> I would like to attach files (or some sort of binary content, anyway) to PDF
> files, without destroying the PDF'ness of the file. I would also like to be
> able to read the created PDF file and be able to tell what is the attachment
> (and what is the original content). I have found Itext (Java, see
> http://itextpdf.com/). It seems to be able to do that and everything else
> too, but is there any other alternative? Preferably in Erlang.
>
>
> bengt
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

erlpdf.pdf (68K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

bengt
In reply to this post by Chandru-4
Thank you for the tip. When I look at the Erlguten documentation it seems to write-only of PDF. No read functions.

bengt

On 26 Jan 2017, at 10:28, Chandru <[hidden email]> wrote:

Have you looked into erlguten? 


cheers,
Chandru

On 25 January 2017 at 21:06, bengt <[hidden email]> wrote:
Greetings,

I would like to attach files (or some sort of binary content, anyway) to PDF files, without destroying the PDF'ness of the file. I would also like to be able to read the created PDF file and be able to tell what is the attachment (and what is the original content). I have found Itext (Java, see http://itextpdf.com/). It seems to be able to do that and everything else too, but is there any other alternative? Preferably in Erlang.


bengt

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

bengt
In reply to this post by Joe Armstrong-2
Greetings,

I forgot to thank Joe for this very helpful code/document. I apologise.

The main benefit is that it explains how the PDF magic works, but I would like to ask if it is allowed to copy some of the code?
Keeping the original
%% Module:  pdf.erl
%% Author:  Joe Armstrong ([hidden email])
%% Date:    2001-12-14
%% Purpose: Manipulate PDF files
%%          Pack and unpack files into PDF files
of course.


bengt

On 26 Jan 2017, at 12:43, Joe Armstrong <[hidden email]> wrote:

I did exactly this a while back.

The enclosed PDF has an erlang program packed inside it.
The erlang program can be used to pack and unpack things inside PDF.

PDF is after all, just a container format (like a zip file)

Hint take a look at the end of erlpdf.pdf in a text editor.

Actually since I always want to read the documentation first - I thought the
code should be *inside* the documentation and NOT the other way around.

Cheers

/Joe


On Wed, Jan 25, 2017 at 10:06 PM, bengt <[hidden email]> wrote:
Greetings,

I would like to attach files (or some sort of binary content, anyway) to PDF
files, without destroying the PDF'ness of the file. I would also like to be
able to read the created PDF file and be able to tell what is the attachment
(and what is the original content). I have found Itext (Java, see
http://itextpdf.com/). It seems to be able to do that and everything else
too, but is there any other alternative? Preferably in Erlang.


bengt

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

<erlpdf.pdf>


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

Joe Armstrong-2
So you have discovered the secret of the code :-)

This was done as a joke but I think you're the only person who got it.

Feel free to use the code.

I suspect that most people (programmers included) think that PDF is a document
format - well It's not - it's a *container format* (like a ZIP file) -
it Just so happens
that 99.99999999999% of all PDF files contain documents encoded in a subset of
postscript.

It's all rather easy all you have to do is read the 1310 [1] page PDF spec [2].

I can highly recommend reading this - I think  PDF and Postscript are
outstanding examples of good design [3].

/Joe

[1] I'm not joking
[2] http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
[3] The designers of Postscript actually asked traditional
typographers about page layout before designing a language.




On Thu, Feb 2, 2017 at 8:10 AM, bengt <[hidden email]> wrote:

> Greetings,
>
> I forgot to thank Joe for this very helpful code/document. I apologise.
>
> The main benefit is that it explains how the PDF magic works, but I would
> like to ask if it is allowed to copy some of the code?
> Keeping the original
> %% Module:  pdf.erl
> %% Author:  Joe Armstrong ([hidden email])
> %% Date:    2001-12-14
> %% Purpose: Manipulate PDF files
> %%          Pack and unpack files into PDF files
> of course.
>
>
> bengt
>
> On 26 Jan 2017, at 12:43, Joe Armstrong <[hidden email]> wrote:
>
> I did exactly this a while back.
>
> The enclosed PDF has an erlang program packed inside it.
> The erlang program can be used to pack and unpack things inside PDF.
>
> PDF is after all, just a container format (like a zip file)
>
> Hint take a look at the end of erlpdf.pdf in a text editor.
>
> Actually since I always want to read the documentation first - I thought the
> code should be *inside* the documentation and NOT the other way around.
>
> Cheers
>
> /Joe
>
>
> On Wed, Jan 25, 2017 at 10:06 PM, bengt <[hidden email]> wrote:
>
> Greetings,
>
> I would like to attach files (or some sort of binary content, anyway) to PDF
> files, without destroying the PDF'ness of the file. I would also like to be
> able to read the created PDF file and be able to tell what is the attachment
> (and what is the original content). I have found Itext (Java, see
> http://itextpdf.com/). It seems to be able to do that and everything else
> too, but is there any other alternative? Preferably in Erlang.
>
>
> bengt
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>
> <erlpdf.pdf>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

Fred Youhanaie-2

On 02/02/17 10:13, Joe Armstrong wrote:
>
> I can highly recommend reading this - I think  PDF and Postscript are
> outstanding examples of good design [3].

And, of course, like all good designs they are open to abuse ;-)

        http://seclists.org/fulldisclosure/2017/Jan/89

Cheers,
f.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Looking for Erlang code that handles PDF file attachments

Anthony Ramine-4
In reply to this post by Joe Armstrong-2
https://twitter.com/simoncozens/status/806454191262531584

> Le 2 févr. 2017 à 11:13, Joe Armstrong <[hidden email]> a écrit :
>
> it's a *container format*

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions