Telerik Forums
Telerik Document Processing Forum
1 answer
109 views
I'm exporting an list of people where the first column is a photo.

But regarless of changing the width/height the file size stays the same. Is there a way to reduce resolution ?

foreach (DataRow _dr in DS.Tables["PHOTO"].Rows)
          {
              FloatingImage image = new FloatingImage(sheet, new CellIndex(startRow, 0), 0, 0)
              {
                  ImageSource = new ImageSource((byte[])_dr["FOTO_EMPREGADO"], "jpg"),
                  Width = 65,
                  Height = 70
              };
 
              sheet.Shapes.Add(image);
 
              startRow++;
          }
Martin
Telerik team
 answered on 16 Mar 2020
3 answers
124 views
I'd like to know if with the new radWordsProcessing control/routines can be able to

1) load an existing docx.
2) Modify and replace some string and then
3) prepare and download to final user with the modified docx...

I've read all your documentation and I fear that I understand that we can not change the text of the document.
I've seen the merge field... but I don't know if I can put them in template doc ... that ... will be modify ...

This control is excellent ... to create ... but can the final user prepares a lot of templates and then can he use to make custom letters with some data?

merci... and thanks so much

geppo

Now I download the windows ... component... because I understand the need...

:-)

Dimitar
Telerik team
 answered on 05 Mar 2020
1 answer
294 views

 

Hello,

I want to open a docx, find and replace an image in the header and replace another image in the body. How can I achieve that?

Thanks

Dimitar
Telerik team
 answered on 05 Mar 2020
3 answers
130 views

Is this even possible?  I'd like some advice.

I'd like to be able to visually show a document on screen and build each page.  I'd like each page to be a grid with user selected number of columns and rows and be able to drag the borders to change the size.  Then I'd like to be able to drag various UI elements into each grid cell.  If it's possible, is there any Telerik training available for this?

 

Dimitar
Telerik team
 answered on 27 Feb 2020
1 answer
506 views

hi

Is there anyway i can disable/lock the saved PDF after using RadFixedDocument to fill up the form field?

I do not want user to edit the field's content after they have filling up a web form and i merged the data to to the predefined PDF form.

Thank you.

Dimitar
Telerik team
 answered on 20 Feb 2020
3 answers
706 views
I am probably asking the impossible here but I need to create a .NET Console Application that will generate a Word Document using a Word Template.  Parts of the Word document will be populated from data stored in SQL Server.  We are currently using Telerik UI for ASP.NET AJAX 2016 R3 version 45. Our preferred language is C#.  If you could point me in the right direction and provide me with some sort of sample code, I would greatly appreciate it.  Any help that you can provide will be greatly appreciated. 
Martin
Telerik team
 answered on 19 Feb 2020
1 answer
1.0K+ views

We are already using Telerik UI for WPF R1 2018 SP2 in C# .Net, and now we would like to use the PdfProcessing libraries to digitally sign a PDF document.

 

Using the code from here, https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/features/digital-signature I crafted a method to sign a PDF document. However, the resulting signed PDF gets an error when opened in Adobe Acrobat: hovering over the signature field gets a tooltip with "error during validation", and selecting the signature field opens a dialog box that says "Error during signature verification. Adobe Acrobat error. Expected a dict object." If I right-click the signature field and select View Signed Version in the popup menu, and select View Report in that view, I get a dialog box that says "Unrecognized PDF content: The document contains PDF content or custom content not supported by the current version of Adobe Acrobat Reader." with a report code of 4000.

 

This is the code I'm using; is there something I'm missing? Like I mentioned, I'm using the code from the Telerik Docs, with the exceptions that the input and output are byte arrays, and the size and position come from passed in metadata realized through the ParseSignaturePosition() method.

 

private byte[] MySignPDF(byte[] pdfData, IDocumentStore documentStoreItem, X509Certificate2 certificate)
{
    var sourcePdfDocument = new PdfFormatProvider().Import(pdfData);
    (int signaturePositionTop, int signaturePositionLeft, int signatureFieldWidth, int signatureFieldHeight, int signatureFieldPage) =
        ParseSignaturePosition(documentStoreItem, sourcePdfDocument);

    var pdfForm = new Form();
    pdfForm.FormSource = new FormSource();
    pdfForm.FormSource.Size = new Size(signatureFieldWidth, signatureFieldHeight);

    var editor = new FixedContentEditor(pdfForm.FormSource);
    pdfForm.Position.Translate(signaturePositionLeft, signaturePositionTop);
    editor.DrawText($"{certificate.GetNameInfo(X509NameType.SimpleName, false)} {DateTime.Now.ToString("yyyy.MM.dd HH:mm")}");

    var pdfSignature = new SignatureField("SignatureField");
    pdfSignature.Signature = new Signature(certificate);

    var signatureWidget = pdfSignature.Widgets.AddWidget();
    signatureWidget.Content.NormalContentSource = pdfForm.FormSource;
    signatureWidget.Rect = new Rect(
        new Point(signaturePositionLeft, signaturePositionTop),
        new Size(signatureFieldWidth, signatureFieldHeight));
    signatureWidget.RecalculateContent();

    var pdfPage = sourcePdfDocument.Pages[signatureFieldPage];
    pdfPage.Annotations.Add(signatureWidget);

    var pageEditor = new FixedContentEditor(pdfPage);
    pageEditor.Position.Translate(signaturePositionLeft, signaturePositionTop);
    pageEditor.DrawForm(pdfForm.FormSource);
    sourcePdfDocument.AcroForm.FormFields.Add(pdfSignature);
    signatureWidget.RecalculateContent();

    return new PdfFormatProvider().Export(sourcePdfDocument);
}

Dimitar
Telerik team
 answered on 19 Feb 2020
1 answer
254 views

I'm trying to figure out if Telerik.Documents.Core.dll will read a PDF file or PDF portfolio  , get the file name and binary data and also get their attachments and file name and binary data 

if so, where can I download and offline trial version of the Telerik.Documents.Core.dll

Dimitar
Telerik team
 answered on 24 Jan 2020
1 answer
135 views

I'm trying to resize/position an image on a PDF document but having issues converting from DIP to PX.

How does one do it since when i manipulate images its in PX but PDFProcessing needs it in DIPs

 

 

dim x as integer=100
 
dim y as integer=100
 
Dim doc1 As RadFixedDocument = provider.Import(page)  ' page containes blank pdf byte array created using document.Pages.AddPage()
 
Dim pg As RadFixedPage = doc1.Pages(0)
 
Dim ms As New IO.MemoryStream(img)
 
Dim Image As New Telerik.Windows.Documents.Fixed.Model.Resources.ImageSource(ms)
 
Dim t As Objects.Image = pg.Content.AddImage(Image)
 
t.Position.Clear()
t.Position.Translate(PX2DIP(x), PX2DIP(y))
Return provider.Export(doc1)

Dimitar
Telerik team
 answered on 16 Jan 2020
1 answer
249 views

I have multiple tables that are stacked vertically.  In this scenario, the first table has text that wraps to the next line.  After the table drawn, the position is calculated and the next table is drawn.

The issue is that the second table covers part of the first table, but only when the last line of the first table has text that wraps

Below is the code that we are using to calculate postion.

var tableSize = table.Measure(RemainingPageSize);

position.YPosition += tableSize.Height + defaultLineHeight;
editor.Position.Translate(position.XPosition, position.YPosition);

Note:

position.YPosition and postion.XPosition are type "double"

 

 

6.5.0
Georgi
Telerik team
 answered on 13 Jan 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?