Welcome Guest Search | Active Topics | Sign In | Register

Errors saving pdf Options
Torsten Boye
Posted: Monday, September 30, 2013 7:09:00 AM
Rank: Newbie
Groups: Member

Joined: 9/30/2013
Posts: 1
Hi,


The following code:

PdfDocument doc = new PdfDocument("C:\\temp\\TestA.pdf");
doc.Save("C:\\temp\\TestAafter.pdf");

Thows this error on Save: An fill-in form field must have a Name.
This is the callstack:

at EO.Pdf.PdfField.a()
at EO.Pdf.PdfOnOffField.a()
at EO.Pdf.PdfCheckBoxField.a()
at EO.Pdf.PdfField.a()
at EO.Pdf.Internal.j8.a()
at EO.Pdf.Internal.i0.a()
at EO.Pdf.PdfDocument.a()
at EO.Pdf.PdfDocument.Save(String fileName)

If I modify the code like this:

PdfDocument doc = new PdfDocument("C:\\temp\\TestA.pdf");

foreach (PdfField field in doc.Fields)
{
field.Color = new PdfColor(System.Drawing.Color.Pink);
}

doc.Save("C:\\temp\\TestAafter.pdf");

I get this error on save: Property 'Rect' can not be empty.
The stacktrace is this:
at EO.Pdf.Internal.ai.a[a](String A_0, Boolean A_1)
at EO.Pdf.Drawing.PdfRectangle.a(ai A_0, String A_1, Boolean A_2)
at EO.Pdf.Internal.m6.d()
at EO.Pdf.Internal.m6.h()
at EO.Pdf.PdfField.b()
at EO.Pdf.PdfField.c()
at EO.Pdf.Internal.j8.b()
at EO.Pdf.PdfDocument.a()
at EO.Pdf.PdfDocument.Save(String fileName)

Any ideas ?

Im using EO.pdf version 5.0.34.2. If you need the pdf file for debugging just contact me om my email an i will send it to you.

/Torsten Boye
eo_support
Posted: Monday, September 30, 2013 9:33:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Thanks for posting in the forum. We will need the PDF file in order to look into it. We will PM you as to where to send the file.
eo_support
Posted: Monday, September 30, 2013 11:10:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi,

We have posted a new build that fixed the "An fill-in form field must have a Name." error. Please see your private message for the download location.

As to the "Property 'Rect' can not be empty", you will need to change your code like this:

Code: C#
foreach (PdfField field in doc.Fields)
{
    if (field.Children.Count == 0)
        field.Color = ......
}


Note that you have to check whether the field is a "terminal" field first because fields in a PDF file can be organized as a tree. You can only set Color on the "terminal" fields.

Hope this helps. Please feel free to let us know if there is anything else.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.