I've seen some ABCpdf questions on this site but not this one yet. I am working on a project that requires PDF output with some rather specific options. ABCpdf seems to be able to offer this through their API but the documentation is confusing and/or incomplete.
using (var xpsStream = (MemoryStream)xps.Write(doc))
{
xpsStream.Position = 0;
pdfDoc.Clear();
pdfDoc.Read(xpsStream, new XReadOptions
{
FileExtension = "xps"
});
pdfDoc.Rendering.DotsPerInch = 72;
pdfDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Cmyk;
pdfDoc.Rendering.IccCmyk = "device";
pdfDoc.Save(stream);
}
This renders a PDF that does not come across with the set rendering properties. The documentation does state that in order to save the rendering properties they must be saved via the Save() method in the XRendering class. So I would have to do something like:
pdfDoc.Rendering.DotsPerInch = 72;
pdfDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Cmyk;
pdfDoc.Rendering.IccCmyk = "device";
pdfDoc.Rendering.Save("blah", stream); // they want a "name" argument
The name argument in their documentation is described as "A dummy file name used to determine the type of image required." Later they say "The file name extensions which may be used are .TIF, .TIFF, .JPG, .GIF, .PNG, .BMP, .JP2, .EMF, .PS and .EPS."
Then after the latter version of the code runs, I do get output but it is not PDF, it is either TIF, JPG, or whatever I choose from that list. If I say 'mom.pdf' it throws an error. This is terrible because this is the way they beging the description of the Save() method in XRendering is "Use this method to render the PDF."