- Posts: 9
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Here you should submit your bug reports with logcat.
Form rendering issues with transforms
10 years 3 months ago - 10 years 3 months ago #10081
by alenz316
Form rendering issues with transforms was created by alenz316
We are currently trying to generate PDFs using Forms instead of multiple direct draw calls on PageContent. We want to draw a single Form and then use transforms (scale and translate) with DrawForm() to stamp/tile a pattern on the PDF.
This technique generates the desired results in most PDF viewers but has severe rendering issues in other viewers. The most problematic being the PDF rendering in the Chrome Browser and the Google Drive PDF View application on Android. Different artifacts appear in Inkscape as well.
The FormTiling.pdf attachment was generated using the above technique and the DirectDraw.pdf was created with multiple direct StrokePath() calls on PageContent.
Open FormTiling.pdf in Google Chrome or the Google Drive PDF View application on Android and Zoom in and out to see the rendering issues. Compare to DirectDraw.pdf, which has no issues.
Is there a way to flatten the added Forms as if they were direct draw calls?
For some reason it won't let me attach any files, here are the Dropbox links:
FormTiling.pdf
DirectDraw.pdf
This technique generates the desired results in most PDF viewers but has severe rendering issues in other viewers. The most problematic being the PDF rendering in the Chrome Browser and the Google Drive PDF View application on Android. Different artifacts appear in Inkscape as well.
The FormTiling.pdf attachment was generated using the above technique and the DirectDraw.pdf was created with multiple direct StrokePath() calls on PageContent.
Open FormTiling.pdf in Google Chrome or the Google Drive PDF View application on Android and Zoom in and out to see the rendering issues. Compare to DirectDraw.pdf, which has no issues.
Is there a way to flatten the added Forms as if they were direct draw calls?
For some reason it won't let me attach any files, here are the Dropbox links:
FormTiling.pdf
DirectDraw.pdf
Last edit: 10 years 3 months ago by alenz316.
10 years 3 months ago #10119
by radaee
Replied by radaee on topic Form rendering issues with transforms
are u mean there has some rendering issue for Chrome Browser?
10 years 3 months ago #10176
by alenz316
Replied by alenz316 on topic Form rendering issues with transforms
Yeah there is a rendering issue with Chrome. I filed an issue for it already
code.google.com/p/chromium/issues/detail?id=579720
But... a lot of Google's Android viewers render it incorrectly as well. Given the elevated status of Chrome and Google PDF rendering on Android, is there anything that can be done on your end (e.g. some sort of form flattening?)?
But... a lot of Google's Android viewers render it incorrectly as well. Given the elevated status of Chrome and Google PDF rendering on Android, is there anything that can be done on your end (e.g. some sort of form flattening?)?
10 years 3 months ago #10182
by radaee
Replied by radaee on topic Form rendering issues with transforms
i tested following code to generate grid as each form, and using Chrome open fine.
i think u'd better to avoid to set very short line, chrome may not work perfectly.
i saw your form draw scan line with x delta 1, it is too small i think.
as i saw, u draw a line from (0, 95) to (1, 95)
Code:
private DocForm new_form_grid()
{
DocForm form = m_doc.NewForm();
PageContent cs = new PageContent();
cs.Create();
cs.SetStrokeColor(0xffc6deff);
cs.SetStrokeWidth(1);
Path path = new Path();//just draw a rectangle, bounding form area.
path.MoveTo(0, 0);
path.LineTo(32, 0);
path.LineTo(32,32);
path.LineTo(0, 32);
path.ClosePath();
cs.StrokePath(path);
path.Destroy();
form.SetContent(cs, 0, 0, 32, 32);
cs.Destroy();
return form;
}
private void test_grid(Page page)
{
DocForm dform = new_form_grid();
ResForm rform = page.AddResForm(dform);
PageContent content = new PageContent();
content.Create();//create content, do not forget.
float y = 0;
while(y < 800)
{
float x = 0;
while(x < 600)
{
Matrix mat = new Matrix(10.0f/32, 10.0f/32, x, y);
content.GSSave();
content.GSSetMatrix(mat);
content.DrawForm(rform);//repeat draw this form.
content.GSRestore();
x += 10;
}
y += 10;
}
page.AddContent(content, true);
content.Destroy();
}
i saw your form draw scan line with x delta 1, it is too small i think.
as i saw, u draw a line from (0, 95) to (1, 95)
10 years 3 months ago #10213
by alenz316
Replied by alenz316 on topic Form rendering issues with transforms
Changing from (0, 95) to (1, 95) to (0, 95) to (95, 95) worked, but (0, 95) to (2, 95) did not. Do you know what that threshold should be? What is considered too small?
Time to create page: 0.501 seconds