Regarding Aspose.pdf

Are there plans to allow for the dynamic creation of form fields inside newly created Pdf or existing PDF?

Actually i am searching for some .net source or Api that is having a UI from where I can add form field like (Text box, dropdownlist,checkbox ), Important requirement Is that that source should have some UI where I can able to add form field through UI.

I already gone through GitHub - aspose-pdf/Aspose.PDF-for-.NET: Aspose.PDF for .NET examples, plugins and showcase projects
But this source is not having any UI controls thats is the problem.
Pls replay me as soon as possible.

@Rajesh2312

Aspose.PDF for .NET does not offer and UI based editor or control to integrate within applications. You can however only use it in the codebehind to perform operation over PDF documents. In case you need assistance while using the API in codebehind, please feel free to let us know.

OK, can u help me out I am having one more doubt.
I am adding 2 text at the same time with for loop, my label variavle is having (text1,text2)
but while doing so its saving only text2 in my pdf, My requirement is that how I can create ( TextFragment textFragmentadd = new TextFragment(label[i]):wink: dynamically for the first and second Text.

Example:

TextFragment textFragmentadd= new TextFragment(“Hi!”);
textFragmentadd.Position = new Position(20, 600-i);
// Set text properties
textFragmentadd.TextState.FontSize = 12;
textFragmentadd.TextState.Font = FontRepository.FindFont(“TimesNewRoman”);
textFragmentadd.TextState.BackgroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray);
textFragmentadd.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);

                    // Append the text fragment to the PDF page
                   
                    textBuilderadd.AppendText(textFragmentadd);
        .
        .
        .
        .
TextFragment n = new TextFragment("n");

n .Position = new Position(20, 600-i);
// Set text properties
n .TextState.FontSize = 12;
n .TextState.Font = FontRepository.FindFont(“TimesNewRoman”);
n .TextState.BackgroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray);
textFragmentadd.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);

                    // Append the text fragment to the PDF page
                   
                    textBuilderadd.AppendText(n );
-------------------------------------------------------------------------------------------------------------------
Pls replay asap.

Here is my code:

: 

 string[] label = s.a.Split(',');  //contain text1,text2
                    TextBuilder textBuilderadd = new TextBuilder(pdfPage);
                    for (int i = 0; i < label.Length; i++)
                    {
                        TextFragment textFragmentadd = new TextFragment(label[i]);
                        textFragmentadd.Position = new Position(20, 600-i);
                        // Set text properties
                        textFragmentadd.TextState.FontSize = 12;
                        textFragmentadd.TextState.Font = FontRepository.FindFont("TimesNewRoman");
                        textFragmentadd.TextState.BackgroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray);
                        textFragmentadd.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);



                        // Append the text fragment to the PDF page
                       
                        textBuilderadd.AppendText(textFragmentadd);
                    }

@Rajesh2312

You are noticing only one text fragment in output because both texts are being added at same position. Please use following code snippet to change position for every new text:

Document document = new Document();
string[] label = ("text1,text2").Split(',');  //contain text1,text2
Page pdfPage = document.Pages.Add();
TextBuilder textBuilderadd = new TextBuilder(pdfPage);
double x = 20, y = 600;
for (int i = 0; i < label.Length; i++)
{
 TextFragment textFragmentadd = new TextFragment(label[i]);
  textFragmentadd.Position = new Position(x, y);
  // Set text properties
  textFragmentadd.TextState.FontSize = 12;
  textFragmentadd.TextState.Font = FontRepository.FindFont("TimesNewRoman");
  textFragmentadd.TextState.BackgroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray);
  textFragmentadd.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);
  // Append the text fragment to the PDF page
  textBuilderadd.AppendText(textFragmentadd);
  y += 15;
}
document.Save(dataDir + "output.pdf");

output.pdf (28.2 KB)

HI, do you have any sample source where we can add formfield with UI controls without using hardcode c# code.

@Rajesh2312

We regret that Aspose.PDF does not provide any UI control to integrate within your application. It can only be used in the codebehind to process PDF files with your desired fucntionality. In case you need further information, please feel free to let us know.

Hi asad,

I am trying to create form field with aspose pdf, just want to know its possible to create document image.png (24.9 KB) like this. Just want to know is this requirement can be satisfied by aspose pdf or not.

Thanks & Regards
Rajesh

@Rajesh2312

The sample image shows tables and checkboxes inside table cells and Aspose.PDF offers the functionality to add tables as well as checkboxes inside table. Please check following articles for more information:

Hi,

I done the research in your aspose pdf, I have generated a sample pdf. But now my requirement is that after opening the generated form field pdf in iframe i want to fill the form field ex textbox and checkbox and after save click that pdf should save with the data I entered in the form field as a new pdf …

Here is the image of my PDF form field image.png (1.7 KB)
. In the pdf i want to ender text in textbox form field and after save button it shoud save when I open the Pdf again, I dont want to add content with hardcode c# code, I want to add using UI.

pls response this ASAP.

Thanks & regards
Rajesh

@Rajesh2312

We are afraid that Aspose.PDF does not provide any UI control in order to show or process PDF documents in browser or any other application. You can though use it in the code behind in order to process the files and implement your desired functionality. In case you need further information or have further inquiry, please feel free to ask.

Thanks for the reply, I have one more doubt in html5 aspose pdf editor for .net.
How I can preload the pdf at the page load without selecting manual…

here is the image image.png (13.3 KB)

@Rajesh2312

You can use same code snippet in Page Load event which is being used for upload button.