Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jul 12, 2018 1:04 am

i'm using 4.6.8 version(include hot fix)

i've found this article on your page

https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/PDF-Image/How-to-Insert-an-Image-to-PDF-Grid-Cell-in-C.html
'How to Insert an Image to PDF Grid Cell in C#'

and i know these function rename to PdfGridCellContentList,PdfGridCellContent

i guess it seems to work at previous version. but anyway it doesn't work anymore.
so i've use Cell.style.BackgroundImage temporary.
if there are need some requirement for achive this, let me know it.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Thu Jul 12, 2018 7:04 am

Hi dahami,

Thanks for your post.
I tested the scenario but don't found any issue. Below is my testing code.
Code: Select all
            string outputFile = @"output.pdf";
            PdfDocument doc = new PdfDocument();           
            PdfPageBase page = doc.Pages.Add();           
            PdfGrid grid = new PdfGrid();           
            grid.Style.CellPadding = new PdfPaddings(1, 1, 1, 1);           
            PdfGridRow row = grid.Rows.Add();           
            grid.Columns.Add(2);
            float width = page.Canvas.ClientSize.Width - (grid.Columns.Count + 1);
            grid.Columns[0].Width = width * 0.25f;
            grid.Columns[1].Width = width * 0.25f;
            PdfGridCellContentList lst = new PdfGridCellContentList();
            PdfGridCellContent textAndStyle = new PdfGridCellContent();
            textAndStyle.Image = PdfImage.FromFile("image1.jpg");
            textAndStyle.ImageSize = new SizeF(50, 50);
            lst.List.Add(textAndStyle);
            row.Cells[0].Value = lst;
            PdfLayoutResult result = grid.Draw(page, new PointF(10, 30));
            doc.SaveToFile(outputFile, FileFormat.PDF);
            System.Diagnostics.Process.Start(outputFile);

I have attached the input image and output document with name "File.zip" for your kind reference.
If the issue still troubles you, please provide following information for further investigation.
1. The input image and the code you were using.
2. OS and Region information, e.g. Win7 64bit, China/Chinese.
Last edited by hogan.tang on Fri Jul 13, 2018 3:37 am, edited 1 time in total.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Thu Jul 12, 2018 8:20 am

thanks for response.
it seems to no difference with my code, but i'll follow your guide on tomorrow.
many thanks

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Thu Jul 12, 2018 8:56 am

Dear dahami,

Thanks for your quick reply, I'm looking forward to your feedback.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Fri Jul 13, 2018 12:19 am

hello again.

after several attempt, i've found that problem is occured on Spire.Pdf.Wpf.dll.
the TestSource is fine on winform. (Spire.Pdf.dll)

i was presume there are no difference between Wpf and C#.
but in some other reason, it wasn't like that.

but i'm working on Wpf Program.
try like this, and let me know your solution.
thanks always

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Fri Jul 13, 2018 4:05 am

Dear dahami,

Thank you for your feedback.
After testing, I'm sorry that the issue occurred using Spire.Pdf.Wpf.dll, and I have logged it in our bug tracking system. We will let you know once there is any update.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Tue Jul 24, 2018 10:09 am

Dear dahami,

Glad to inform that your issue has been fixed in the latest version(Spire.PDF Pack(Hot Fix) Version:4.7.11).
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Tue Jul 24, 2018 11:10 pm

glad to hear that!
i'm sure the problem is fix it.
please send regards to Dev team.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Wed Jul 25, 2018 1:18 am

Dear dahami,

Thanks for your feedback.
Just feel free to contact us if you have any question.
Have a nice day.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Return to Spire.PDF

cron