Page 1 of 1

Gradient fill

Posted: Wed May 30, 2018 4:54 pm
by Yury
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.

Re: Gradient fill

Posted: Thu May 31, 2018 5:54 am
by Lzcat - Tracker Supp
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.

Re: Gradient fill

Posted: Fri Jun 01, 2018 4:33 pm
by Yury
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

Re: Gradient fill

Posted: Sat Jun 02, 2018 6:48 am
by Sasha - Tracker Dev Team
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

Re: Gradient fill

Posted: Mon Jun 04, 2018 11:22 am
by Yury
Hi, where is this "Stroke Adjust" option?

Re: Gradient fill

Posted: Mon Jun 04, 2018 11:39 am
by Sasha - Tracker Dev Team
Hello Yury,

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

Cheers,
Alex