How do I embed PostScript file (EPS/PS) in PDF using PDFNet?

Q:

How do I embed PostScript file (EPS/PS) in PDF using PDFNet?
The pdf is generated but the ps file does not show up.
I use the following code:

// Embed a custom stream (file postscript.ps).
pdftron.Filters.StdFile embed_file = new
pdftron.Filters.StdFile(Server.MapPath("chess.ps"),
pdftron.Filters.StdFile.OpenMode.e_read_mode );
pdftron.Filters.FilterReader mystm = new
pdftron.Filters.FilterReader(embed_file);
pdftron.SDF.Obj ps_stm = myNewPdf.CreateIndirectStream(mystm);
ps_stm.Put("Subtype", pdftron.SDF.Obj.CreateName ("PS"));
// ...
// Then use ElementBuilder and ElementWriter to
// reference the PostScript stream from a given page:
pdftron.PDF.Element epsElement = f.CreateForm(ps_stm);
writer.WriteElement(epsElement);
---
A:

Your code embeds 'pass-through' PostScript in PDF; it does not convert
from PS to PDF.

PostScript XObjects (see section 4.7.1 'PostScript XObjects' in PDF
Reference) are used only when printing to a PostScript output device;
they have no effect either when viewing the document on-screen or when
printing it to a non-PostScript device. In addition, applications that
understand PDF are unlikely to be able to interpret the PostScript
fragments. This PDF feature is used in very specialized applications
and should generally not be used.

Based on your requirements you should first convert your EPS/PS files
to PDF and then import PDF pages as illustrated in ImpositionTest
sample project: http://www.pdftron.com/net/samplecode.html#imposition

ivan @ support