Exporting to PDF with Aspose.Word

Hi

When we use aspose.word to convert a word 2007 document to pdf, it seems like it is not creating the correct black ie. true black with ccyan values: cyan = 0%, magenta = 0%, yellow = 0% and black = 100%

Why is that? If we use normal office word to sabe as pdf, it creates the same document, but the black is a true black and not rich black?

Hi Martin,

Thanks for your inquiry. Could you please attach your input Word document along with the output PDF file here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

Hi

please find attached th word doco, the output thrugh word as well as the aspose version

Hi
Martin,

Thanks for providing the documents. You’re correct, the color tone used in output PDF document looks slightly darker to me. I think, this is because MS WORD uses different codecs to display the shapes particularly in header/footer areas. However, the actual colors i.e. used in PDF can be seen by editing the header/footer in MS Word.

Please let me know if I can be of any further assistance.

Best Regards,

So does that mean there is no setting to change in the code for the pdfOptions and to get it to produce true black?

Hi Martin,

Thanks for your inquiry. I am afraid, there is no such option that you can specify when saving a document into the Pdf format. Also, it would be great if you could give a comparison screenshot as to how you are expecting your output document to be rendered like (with the output generated by MS WORD). I will investigate the issue further and provide you more information.

Best Regards,

The problem now is, when you print a pdf from Aspose, it actually doesnt print true black and means it uses cyan, magenta etc to creeate a black ink. So it doesnt use the black ink from the printer but use all the other colours to create a black from

Hi Martin,

Thanks for your inquiry. We’re working over your query and will get back to you soon.

Best Regards,

Hi Martin,

Thanks for your patience. Until now what I understand, you’re trying to print a PDF file i.e. generated by Aspose.Words v11.2.0 and during printing you’re observing that the Black Text color is not the True Black (i.e. #000000). Well, to me, the black color looks much better when comparing printer outputs of both PDF files (i.e. one generated by Aspose.Words and the other by MS Word), Moreover, the test was made by using Canon MP270 series Printer on our side. Could you please also share your printer specifications, try printing the output PDF document with a different printer and let us know your findings then? We’ll investigate the issue further and provide you more information.

Best Regards,

This isn’t about a subjective “test” based on how the black “looks” in one persons opinion based on the output of a cheap inkjet printer. It’s about printing the produced PDF document in a professional print environment where adherence to standards is a requirement, not an option.

When the “black” is made up of RGB, pages that should be treated, and more importantly billed (colour = $0.08 to $0.12 / sheet, black = $0.005 to $0.008 / sheet), as black and white are billed as colour as 3 of the 4 inks/toners used in professional printing go into the production of the black after the colour space conversion and NOT the the true black ink/toner as should be the case.

The printer specifications are that the document is being produced on a professional printer worth in excess of $100,000, not something they’ll be able to easily replicate on site and definitely not something you can compare a cheap desktop inkjet printer to.

I checked the specs of the MP270, it uses CMYK cartidges. If you were to print a rich black PDF document on it, provided that the driver doesn’t mess with colours (and it shouldn’t), it’ll use up all of the colour in the cartridge and the black ink will probably remain unused. If have seen instances where it uses all 4 of the colours to produce black, which is just a big waste of ink and money. If you print true black, the black cartridge will be used and the other 3 colours won’t be wasted.

To clarify a bit more:

  • Digiting printing happens in CMYK, a completely different colour system than what is being referenced with the RGB hex colour below (#000000). This is simply an RGB representation of black.

  • CMYK uses the colours ©yan, (M)agenta, (Y)ellow and blac(K)

  • RGB is absolutely fine for display on a screen, which uses the RGB colour scheme to generate is colours

  • RGB is absolutely NOT ok for printing in a professional printing house as colour space conversions cause ALL sorts of problems. A prime example is listed above (The True Black of CMYK (0% C, 0% M, 0% Y, 100%K) vs the “Rich Black” of RGB which is converted to varying percentages of the C, M, Y and K values).

MS Word 2007+ (haven’t tested 2003) produces the correct colour formats when using the “Save as XPS/PDF” functionality. This can be easilty verified using Adobe Acrobat Pro. The Aspose component does not. Plain and simple.

Hi Martin,

Thank you for the additional information.

We are now verifying the issues based on the supplied information. We shall get back to you soon with our findings.

Many Thanks

Hi Martin,

you’re right, Aspose.Words uses RGB color space to write gray and black colors to PDF. It’s completely correct and cannot be considered as a bug. #000000 RGB color definitely descibes Black color and so it can be printed as true black.

Both MS Word and Aspose.Words use RGB color space to represent normal colors like red, green, blue etc. When such color is sent to a printer it have to be translated to color space suitable for specific printer.

It’s completely normal that this task is performed by printer driver using color profile corresponding to the printer and cartridge set.

Please, pay attention, that “true” or “rich” black, you get on a printer isn’t coded inside PDF. It’s possible to create CMYK PDF (and it’s actively used for publishing purposes) but neither Aspose.Words nor MS Word create CMYK PDF files.

In professional cases (when total cost of the work is like $100,000) the conversion from RGB to CMYK is performed by special “preflight” (or prepress) tools and it’s definitely responsibility of printing house to make such preflight.

Please, pay attention that if you’re planning to use PDF created by any of MS Word or Aspose.Words for professional publishing, you will have to move the PDF through preflight process as not only gray and black colors should be printed by black ink but any images and even dark plain colors should be correctly separated to CMYK. MS Word doesn’t make it too the same way as Aspose.Words. All problems with quality and cost of rich black will appear with PDF created by MS Word if you will try to print ‘almost black’ like RGB=0,0,1.

Adobe Acrobat makes possible to perform simple prefligh actions with its options. Did you try the following one:

File > Print > Advanced > Color Management > Treat grays as K-only grays?

It should make what you need: converts gray RGB color (where R=G=B) to K (black) ink. It will work for PostScript printers (according to Adobe help).

Although I don’t think it’s a bug of Aspose.Words to write gray and black in RGB color space, we try to make behavior of Aspose.Words closer to MS Word so we will consider writing gray and black colors in Grayscale color space as MS Word does.

Hi Martin,

Thanks for the additional information. I have logged this potential issue in our bug tracking system as WORDSNET-6276. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best Regards,

you’re right, Aspose.Words uses RGB color space to write gray and black colors to PDF. It’s completely correct and cannot be considered as a bug. #000000 RGB color definitely descibes Black color and so it can be printed as true black.

An RGB value of #000000 is NOT true black for print no matter which way you wish to spin it. It is an RGB value, not a CMYK value, a value intended for display on SCREEN and not IN PRINT.

Both MS Word and Aspose.Words use RGB color space to represent normal colors like red, green, blue etc. When such color is sent to a printer it have to be translated to color space suitable for specific printer.

WRONG. Save a document to PDF within MS Word 2007 and above and the colour space is correct and all lines/shading/black text is actually black. ONLY documents produced from this product (Aspose Words) are incorrect.

I am getting tired of debating this, so I will attach PROOF once again.

It’s completely normal that this task is performed by printer driver using color profile corresponding to the printer and cartridge set.

Opinion - reference please

Please, pay attention, that “true” or “rich” black, you get on a printer isn’t coded inside PDF. It’s possible to create CMYK PDF (and it’s actively used for publishing purposes) but neither Aspose.Words nor MS Word create CMYK PDF files.

Please, pay attention, this is WRONG. PDF’s produced from MS Word 2007+ are PERFECT and the ones produced by this product (Aspose Words) are WRONG. To say this in the face of all the proof to the contrary is just incredible.

In professional cases (when total cost of the work is like $100,000) the conversion from RGB to CMYK is performed by special “preflight” (or prepress) tools and it’s definitely responsibility of printing house to make such preflight.

The source document is always the responsibility of the client, not the printing house. To suggest otherwise is ludicrous. The pre-flight to which you are referring is a pre-flight CHECK. They VERIFY the PDF is in the correct format, WHICH IS WHY WE ARE HAVING THIS PROBLEM. If you had actually read what I actually typed in my previous email, you would see that I am not referring to the output being worth $100,000. The PRINTER it is being produced on IS.

Please, pay attention that if you’re planning to use PDF created by any of MS Word or Aspose.Words for professional publishing, you will have to move the PDF through preflight process as not only gray and black colors should be printed by black ink but any images and even dark plain colors should be correctly separated to CMYK. MS Word doesn’t make it too the same way as Aspose.Words. All problems with quality and cost of rich black will appear with PDF created by MS Word if you will try to print ‘almost black’ like RGB=0,0,1.

PLEASE, PAY ATTENTION, THIS IS TOTALLY AND UTTERLY WRONG. I will attach a number of documents to prove this once and for all.

  1. original.docx – this will be the original source document. It will contain black text and a table with various levels of grey.

  2. msword.pdf – this will be the original source document listed in step one saved as PDF within MS Word 2007.

  3. aspose.pdf – this will be the original source document listed in step one produced using Aspose Words

  4. msword_proof.jpg – this will be several screen shots of samples taken with acrobat pro proving that MS Word 2007 DOES produce a correctly formatted pdf ready for print

  5. aspose_proof.jpg – this will be several screen shots of samples taken with acrobat pro proving that Aspose Word completely breaks the produced PDF and makes it unsuitable for print

Adobe Acrobat makes possible to perform simple prefligh actions with its options. Did you try the following one:

File > Print > Advanced > Color Management > Treat grays as K-only grays?

We have tried everything including this simple fix to the produced documents, but none will totally fix it. The one listed here only fixes some of the black text.

Furthermore, the point is that we SHOULD NOT HAVE TO DO THIS AT ALL.

It should make what you need: converts gray RGB color (where R=G=B) to K (black) ink. It will work for PostScript printers (according to Adobe help).

Although I don’t think it’s a bug of Aspose.Words to write gray and black in RGB color space, we try to make behavior of Aspose.Words closer to MS Word so we will consider writing gray and black colors in Grayscale color space as MS Word does.

It IS a bug within Aspose Words as MS Word produces PERFECT documents, Aspose Words DOES NOT. See the attached proof!!!

Please, pay attention, as this is important, Aspose Words DEMONSTRABLY DOES NOT produce correctly formatted PDF documents. MS Word 2007+ DOES.

Hi Martin,

thank you for your screenshots. I hope you will have time to look at mine. To be shorter, I would like to demonstrate you MS Word behavior only, leaving Aspose.Words behind the scene at the moment.

I’m attaching MS Word file with a table with two rows. Visually, they both are black. They look equal in MS Word. But the first is simple black (set by Fill/Black button) and the second one is almost black (set by Fill/More Colors/Custom/R=0,G=0,B=1).

The second attached file is “perfect” PDF saved by MS Word 2007. If you will open it in Adobe Acrobat 9, you notice no difference in black color for these two rows - “perfectly”.

Then, please, open “Output preview” (the same as you’ve done for your screenshots) and wonder. You will see that two rows have significantly different look. Please, move a mouse pointer over one and the other rows (the same as you’ve done) and wonder again:

First row has C=0,M=0,Y=0,K=100 color
Second row has C=75,M=68,Y=67,K=90 color

Rows of this table will be printed on your printer by two essentially different ways (I suppose, you understand it). I hope this example will help you to understand my points in the previous post: MS Word doesn’t save CMYK colors to Pdf. MS Word just does the simplest workaround for R=G=B case (the same as mentioned check mark in Adobe Acrobat) - it saves it in Grayscale color space which perfectly converted to blac(K) ink by Adobe Acrobat.

On your screenshots Adobe Acrobat does not show colors in PDF - it shows CMYK result which is calculated by Adobe Acrobat itself. If you want to see original colors, saved in PDF, you can try to import the PDF into Adobe Illustrator, for example. Or some preflight tool.

Please, try to reread my previous post not as opinion of some guy who doesn’t understand what you mean but as professional explanation of a man with more than 5 years experience in colored design and preflight.

Be sure, preflight is not a “check”, it’s a “work”. If “they” just check, someone has to do this work if you want to get good result for full-color documents.

And another screenshot of Acrobat Reader for the same PDF saved by MS Word 2007. You can see that MS Word saves colors in either DeviceGray (R=G=B=0 in source Docx) or DeviceRGB (R=G=0, B=1 in source Docx) color spaces.

It doesn’t save CMYK into PDF. And it makes colors which are very similar in source document to be essentially different in output PDF. That’s why MS Word is not perfect tool for publishing. And that’s why you would like to perform the following steps to prepare this document for publishing:

  1. Convert Grayscale to RGB(this will make two rows to be of the same color);

  2. Convert RGB to CMYK.

Current behavior of Aspose.Words is worse for simple case when there are no complex colors in a document. But it’s more professional - the distance between Black and Almost Black remains small. As a result, you need only one operation during professional preflight:

  1. Convert RGB to CMYK.

Nevertheless, Aspose.Words isn’t intended to be professional publishing tool (as well as MS Word) and our priority is to make its behavior closer to MS Word.

Hi Martin,
Firstly, I would like to apologize for Andrey’s reply where his wording might have offended you. We reviewed this together and please take my assurances he meant no harm. The particular phrases that created the horrible effect would have been polite and acceptable in a reply to a customer in our native language.
The most important point that Andrey wanted to make was at the end of the reply where he said that we will try to make Aspose.Words to output colors more like MS Word. Sorry this got buried under everything else. I can only attribute this to an engineer being too excited about the issue.
I confirm that we will look at improving Aspose.Words to output colors more like MS Word, particularly to address the CMYK black color problem that you reported. We will do this asap.

Hi Martin,

I’ve improved Aspose.Words PDF rendering so it writes gray color in
DeviceGray color space like MS Word do. Please check the attached PDF document
generated by Aspose.Words and tell us if it is good for you.

Thanks for that, yes it produces a black that comprises of only K and no CMY colour values.

Good. Then this fix will be included into the next release.