Gradient fill

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Yury
User
Posts: 70
Joined: Fri Oct 14, 2011 9:32 am

Gradient fill

Post by Yury » Wed May 30, 2018 4:54 pm

Hello, here is the file created with the CoreAPI SDK.
The box is filled by gradient brush.
However, inside the PDFX Editor I see the many horizontal lines instead of gradient fill.

Adobe Reader shows this file properly as gradient filled box.

Anything wrong with the PDF output generation, or issue with Editor's rendering?

Regards,
Yury.
Attachments
Chart 1.pdf
(5.76 KiB) Downloaded 38 times

Lzcat - Tracker Supp
Site Admin
Posts: 712
Joined: Thu Jun 28, 2007 8:42 am

Re: Gradient fill

Post by Lzcat - Tracker Supp » Thu May 31, 2018 5:54 am

Hi Yury.
There is two issues - one with file, and second with Editor rendering.
Regarding to file - it does not contain any gradient, it contain a lot of filled rectangles with different colors. I don't know how you create it, but CoreAPI support native gradients in PDF, which looks much better in most readers and take less place in file. Please see IPXC_Document::CreateLinearShade and IPXC_ContentCreator::Shade methods.
Second issue is rendering in Editor for such specific case: when many rectangles or lines are touching each other there are border pixels, which are not fully covered by any of figures (but may be covered with many figures). Such border pixels color is combination of colors of background and covering figures, with different coefficients, depending how figure cover this pixel. Therefore when changing zoom level you may see that they change color and thin lines (no more than 1 pixel wide) may appear. To deal with such cases Adobe using not documented algorithm called Stroke Adjust. This algorithm is "simply" change figures coordinates and line width so they fit pixel grid. As result all pixels are fully covered by one or many figures and border pixel will have color of one of figures. In current build Editor does not have such algorithm, but it is in developing right now, so next major build should have it.
HTH.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

Yury
User
Posts: 70
Joined: Fri Oct 14, 2011 9:32 am

Re: Gradient fill

Post by Yury » Fri Jun 01, 2018 4:33 pm

Hi Victor, thanks for response.

Issue is a bit more complex.
We generating the PDF from the EMF image, which is result of GDI+ output.
We use core API SDK for this.
This topic below is an illustration of how it is used.
viewtopic.php?f=67&t=24322&p=94991&hilit=Yury#p94991
According to your response, EMF is parsed not proper - it produces the rectangles instead of gradient fill.

Is it possible to fix? Or may be it is fixed already.
I'm attaching the EMF, which is used in previous PDF output.

Regards,
Yury
Attachments
Gradient.zip
(2.83 KiB) Downloaded 26 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4310
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Gradient fill

Post by Sasha - Tracker Dev Team » Sat Jun 02, 2018 6:48 am

Hello Yury,

When the Stroke Adjust is enabled we'll show this as the Acrobat does - the release itself will be held around the end of June.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Yury
User
Posts: 70
Joined: Fri Oct 14, 2011 9:32 am

Re: Gradient fill

Post by Yury » Mon Jun 04, 2018 11:22 am

Hi, where is this "Stroke Adjust" option?

User avatar
Sasha - Tracker Dev Team
User
Posts: 4310
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Gradient fill

Post by Sasha - Tracker Dev Team » Mon Jun 04, 2018 11:39 am

Hello Yury,

As I said previously, this functionality will be available from the next release.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply