HI Guys
I was wondering if you WebForms PdfViewer can accomplish updating fillable PDF and save the data entries into a new PDF, explain
I have a fillable PDF with a few fillable textboxes, and I would like to capture the user inputs and save as a new PDF for then later continue filling the blanks loading the new saved PDF.
I've tried accomplishing the task using iTextSharp but it was not possible here is my code for reference.
string existingPdfilePath = Server.MapPath("~/export/I-693_1000_202502191951256806.pdf"); string updatedPdfPath = Server.MapPath("~/App_Data/I-693_" + Guid.NewGuid().ToString() + ".pdf"); using (FileStream pdfReaderStream = new FileStream(existingPdfilePath, FileMode.Open, FileAccess.Read)) { using (FileStream pdfWriterStream = new FileStream(updatedPdfPath, FileMode.Create, FileAccess.Write)) { PdfReader reader = new PdfReader(pdfReaderStream); PdfStamper stamper = new PdfStamper(reader, pdfWriterStream); AcroFields formFields = stamper.AcroFields; foreach (DictionaryEntry de in reader.AcroFields.Fields) { //sb.Append(de.Key.ToString() + Environment.NewLine); var fullname = formFields.GetTranslatedFieldName(de.Key.ToString()); formFields.RenameField(fullname, Guid.NewGuid().ToString("N")); if (de.Key.ToString() != fullname) if (!String.IsNullOrEmpty(de.Value.ToString())) { if (fullname != "form1[0].#pageSet[0].Page1[9].PDF417BarCode2[0]") { formFields.SetField(de.Key.ToString(), de.Value.ToString()); } } } stamper.Close(); reader.Close(); }
As a PDFViewer I am using the plain html embed tag
<embed class="pdf" src= "~/Templates/I-693_100_2025045512.pdf" width="800" height="500" />
The user data entries vanish like a ghost, and when saving it just make a copy of the original with no captured data entries
Can your PDFViewer accomplish the task?
hi,
we are looking for a component (client side is preferred) that gets 2 inputs: a json schema and a json data fields that match the schema.
the component should generate a static html component (not inputs) to nicely display the data values according to the schema
for example in case we have 3 items of types string, number and boolean.
Name: David the king
Age: 38
Married: Yes
do you have such component? maybe created as PDF?
Hi,
I'm testing the PDF Signature demo shown in this Telerik example PDF Signature demo. The issue I'm having is I cannot pull a pdf that resides on a network file server where we store all common files. I have no issues loading a pdf on my localhost machine.
From what I can tell, the issue appears to be the third party opensource pdf.js file Telerik is using in demo that seems confined to only load pdf's from directories within the web application and it's sub-folders defined in IIS for the website. Also, the network file server is used everywhere within our web application so it's not a security issue.
The error I get from pdf.js is "Not allowed to load local resource" which results in page prompt "PDF file fails to process." display.
We have an existing web.config entry that looks like this:
<add key="AttachmentsShare" value="\\my_file_server\file"/>
I've tried calling the file server a few different ways with no luck.
RadPdfViewer1.PdfjsProcessingSettings.File = ConfigurationManager.AppSettings("AttachmentsShare") & "1234.pdf"
RadPdfViewer1.PdfjsProcessingSettings.FileSettings.Url = ConfigurationManager.AppSettings("AttachmentsShare") & "1234.pdf"
Please advise. Thanks.
I am trying to use ExportToPdf to generate a .pdf document from a RadGrid. Here's a simplified version of my grid. The labels export to the .pdf, but the table with "TGIF" does not. I need to use HTML formatting to arrange the labels. What am I doing wrong? Thanks!
<telerik:RadGrid ID="gridTest" runat="server" AutoGenerateColumns="False"
Skin="Default" Width="800px"
OnItemCreated="gridTest_ItemCreated" >
<ExportSettings
IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="False">
<Pdf PaperSize="Letter"></Pdf>
</ExportSettings>
<MasterTableView ShowHeader="false">
<Columns>
<telerik:GridTemplateColumn DataField="strCaseID" UniqueName="strCaseID" ShowFilterIcon="false" >
<ItemTemplate>
<table>
<tr>
<td>
TGIF!
</td>
</tr>
</table>
<asp:Label ID="lbName" runat="server" Text='<%#Eval("strEmployeeFName")%>' ></asp:Label><br />
<asp:Label ID="lbAddressStreet1" runat="server" Text='<%#Eval("strEmployeeAddressStreet1")%>' ></asp:Label><br />
<asp:Label ID="lbAddressStreet2" runat="server" Text='<%#Eval("strEmployeeAddressStreet2")%>' ></asp:Label><br />
<asp:Label ID="lbAddressCity" runat="server" Text='<%#Eval("strEmployeeAddressCity")%>' ></asp:Label><br />
<asp:Label ID="lbAddressState" runat="server" Text='<%#Eval("strEmployeeAddressState")%>' ></asp:Label><br />
<asp:Label ID="lbAddressZip" runat="server" Text='<%#Eval("strEmployeeAddressZip")%>' ></asp:Label><br />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
in Page_Load...
PopulateGrid(gridTest);
ConfigureGridBeforeExportToPdf();
gridTest.MasterTableView.ExportToPdf();
protected void gridTest_ItemCreated(object sender, GridItemEventArgs e)
{
try
{
ConfigureGridItem(e.Item);
}
catch (Exception ex)
{
// do stuff
}
}
protected void ConfigureGridItem(GridItem item)
{
// ***** THIS IS FOR - each Item
item.Style["color"] = "purple"; // font color
if (item is GridHeaderItem)
{
item.Visible = false;
}
else if (item is GridDataItem)
{
item.Style["vertical-align"] = "middle";
item.Style["text-align"] = "left";
}
switch (item.ItemType)
{
case GridItemType.Item: item.Style["background-color"] = "lightyellow"; break;
case GridItemType.AlternatingItem: item.Style["background-color"] = "mistyrose"; break;
}
}
public void ConfigureGridBeforeExportToPdf()
{
// ***** THIS IS FOR - entire Grid
// format - Pdf Settings
gridTest.ExportSettings.Pdf.BorderType = GridPdfSettings.GridPdfBorderType.OuterBorders;
gridTest.ExportSettings.Pdf.BorderStyle = GridPdfSettings.GridPdfBorderStyle.Thick;
gridTest.ExportSettings.Pdf.BorderColor = System.Drawing.Color.HotPink;
gridTest.ExportSettings.Pdf.PaperSize = GridPaperSize.Letter;
gridTest.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm");
gridTest.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm");
// format - header
GridItem headerItem = gridTest.MasterTableView.GetItems(GridItemType.Header)[0];
headerItem.Visible = false;
// format - footer
gridTest.ExportSettings.Pdf.PageFooter.MiddleCell.Text = "<?page-number?>";
gridTest.ExportSettings.Pdf.PageFooter.MiddleCell.TextAlign = GridPdfPageHeaderFooterCell.CellTextAlign.Center;
}
Hi,
I have several PDFViewer in different pages of my application, contained in div that can be collapsed.
Depending of the pages the div can be collapsed or not at loading of the page.
For the ones that are not collapsed, the PDFViewer scale is set to "Fit to Width" and the scaling is ok.
However, for the ones that are in collapsed div, the "Fit to Width" setting is not processed.
Attached is a project with the described behavior.
Is there a way to manage the scaling properly on collapsed PDFViewer ?
I want to add a watermark to the pdf file to be displayed in pdfviewer.
Please inquire if it is possible.
We switched from using your DLLs directly to pulling from Nuget.
We were originally targeting the .NET Framework version of your libraries and planned to continue to do so.
However in the conversion it was realized that Telerik.Web.Spreadsheet is only available as Standard in your Nuget. Therefore due to this ONE missing library I had to convert everything to Standard.
This was fine until we realized that Standard isn't capable of embedding subset fonts into PDFs like Framework, leading to larger files.
I attempted to do a mix of the two and failed but I'd really rather not do that anyway.
Could you please properly update your Nuget to include the Framework version of Telerik.Web.Spreadsheet? I know it exists because I used it before moving to Nuget.
Thank you
Hi,
I can get my pdf file from sql svr database to view on browser:
DataRow dr = dsFile.Tables[0].Rows[0];
Byte[] fileBuffer = (byte[])dr["DocumentBinary"];
if (fileBuffer != null)
{
radviewPdf.PdfjsProcessingSettings.FileSettings.Data = Convert.ToBase64String(fileBuffer);
}
How to view the PDF without saving to a folder (say ..\Download)?
On MS Edge, browser asks to click Open file but it also saved to Download.
On Chrome, browser asks to save file.
Thanks,
DT
Hey all, l was wondering how I would go about removing these huge gaps on my <li> upon export. I'm placing dynamic values from state. I attached the before and after images.
</li>
</ol>