Telerik Forums
Telerik Document Processing Forum
2 answers
250 views
Hi,

I have a view which looks something like this:
<Viewbox>
    <Canvas Width="800" Height="1050" x:Name="caContent">
        <Image x:Name="imgBackground" Source="Images/Proto1.png" Stretch="UniformToFill" Width="800" Height="1050"/>
    </Canvas>
</Viewbox>

At runtime I load a background image an after that I place controls (TextBlock) on the Canvas which are bound to data.
So after all I have some kind of a report "printed" on the screen.
I can also print this report (it's designed to fit on A4 paper format).

Now my question - is there an easy way to save this report as PDF?

I've seen your samples where FirstLook looked promising - but I had to learn that it displays an image "resultDocument...png" and not the data.
And the "rendering code" is working with a "FixedContentEditor" and special rendering.

My idea was that I can "print" to your PDF component like to a printer - or in other words - use the existing (for screen rendering) code and simply render the result to PDF.
Is this possible?

Thank you
Manfred
ManniAT
Top achievements
Rank 2
 answered on 24 Mar 2015
2 answers
316 views
Is there a way to output one specific worksheet to a PDF document?  Or, must I always rely on spreadsheet formatting?
Joel Palmer
Top achievements
Rank 2
 answered on 18 Mar 2015
3 answers
332 views
Hi,

we are currently using a free PDF Library to convert some XPS documents to PDF.
The XPS document has pages with different heights (so for an example page 1 is 6 cm high while page 2 has 11 cm).

Is this (render an XPS to PDF) also possible with telerik PDFProcessing?

The reason why I ask - we love your products (and quality, support,...) and the PDF library is the only "external component" (except telerik controls) we use in a pretty large project. It would be great to get rid of "the others" and instead use your PDFProcessing.

Thanks
Manfred
Tanya
Telerik team
 answered on 17 Mar 2015
1 answer
199 views
I love you output to PDF option.  Do you also have an export to XPS?
Tanya
Telerik team
 answered on 17 Mar 2015
1 answer
283 views
Hi!

Using RadFixedDocumentEditor.SectionProperties I can set PageSize and PageMargins, but I can't find a way to set the page orientation. Am I missing something?

Regards
Neils
Tanya
Telerik team
 answered on 12 Mar 2015
1 answer
647 views
The help is little bit scarce on registering a font: see http://docs.telerik.com/devtools/wpf/controls/radpdfprocessing/concepts/fonts

There is a data parameter at the end, which should contain the raw data for the font. Looking for more information about the subject I came across https://github.com/telerik/xaml-sdk/blob/f5002a15eb1def98405472bee700f20ad8b65cc9/SpreadProcessing/RegisterAndExportPdfFonts.Web/PdfFontsService.svc.cs where 

public class FontData {
  public bool IsValid { get; set; }
  public byte[] Bytes { get; set; }
  public string FontFamilyName { get; set; }
  public bool IsItalic { get; set; }
  public bool IsBold { get; set; }
}

is defined. Which is used from https://github.com/telerik/xaml-sdk/blob/f5002a15eb1def98405472bee700f20ad8b65cc9/SpreadProcessing/RegisterAndExportPdfFonts/MainPage.xaml.cs to get the Bytes property of the above class to register a font:

PdfFontsServiceFontData result = e.Result;
FontFamily fontFamily = new FontFamily(result.FontFamilyName); FontStyle fontStyle = GetFontStyle(result.IsItalic); FontWeight fontWeight = GetFontWeight(result.IsBold);
FontsRepository.RegisterFont(fontFamily, fontStyle, fontWeight, result.Bytes);

So is this the right way to create the font data:

FontFamily fontFamily = new FontFamily(fontFamilyName);
FontStyle fontStyle = isItalic ? FontStyles.Italic : FontStyles.Normal;
FontWeight fontWeight = isBold ? FontWeights.Bold : FontWeights.Normal;
Typeface typeface = new Typeface(fontFamily, fontStyle, fontWeight, FontStretches.Normal);
GlyphTypeface glyphTypeface;
if (typeface.TryGetGlyphTypeface(out glyphTypeface)) {
   using (var memoryStream = new MemoryStream()) {
       glyphTypeface.GetFontStream().CopyTo(memoryStream);
       data.Bytes = memoryStream.ToArray();
       data.IsValid = true;
   }
}

Thanks

Mike

Kammen
Telerik team
 answered on 04 Mar 2015
1 answer
804 views
I'm playing with 2015Q1 and export a simple text document with PDF/A-3b compliance level.

When I check the resulting pdf file, the validation service states:

Validating file "Testpdf.pdf" for conformance level pdfa-3b
  The font Helvetica must be embedded.
  The document does not conform to the requested standard.
The document contains fonts without embedded font programs or encoding information (CMAPs).Done.

How can I specify, that a standard font should be embedded?

Thanks

Mike
Petya
Telerik team
 answered on 03 Mar 2015
1 answer
933 views
Hello,

I proposed to use the RadRichTextEditor to edit simple Docx documents and use the format providers to convert the docx documents to html (for sending as html e-mail).
But now I found that there is also the new WordsProcessing which can do the same conversions.
If I am right WordsProcessing does not (yet?) have an editor for visual editing. (Is that proposed? Or is the RadRichTextEditor the proposed way to go?).
For the conversion from Docx to Html, are there any pros or cons or difference in quality in using the format providers found in the RichTextEditor assembly or the WordsProcessing assemblies?
Or use they in fact the same code base?
Petya
Telerik team
 answered on 25 Feb 2015
1 answer
724 views
Hello,
I have a huge CSV file (about 3.3M lines), that I had to import for filtering and processing part of it.
I've tried to looked at your CsvFormatProvider class to do the work. Unfortunately, the only possibility to work with it is to create a Workbook and the workbook is limited to about 1M lines.

Is there any possibility to have a "low-level" importing of the CSV file?
For example to import one line of data per call. The import returning an array of String.
Or do you have another solution for this problem?

Patrick
Nikolay Demirev
Telerik team
 answered on 17 Feb 2015
5 answers
490 views
I am struggling to get PNG files with transparency to import into a PDF. I have tried several different PNG files with no look. The transparent background section either comes out as black or blurred.

Please see the code I have been experimenting with below.

--------------------------------

Dim FormatProvider As New PdfFormatProvider
FormatProvider.ExportSettings.ImageQuality = ImageQuality.High
Dim Document As New RadFixedDocument
Dim Page As RadFixedPage = Document.Pages.AddPage()
Page.Size = New Size(PageWidth, PageHeight)
Editor = New FixedContentEditor(Page)

'Method 1
Editor.Position.Translate(0, 0)
Dim imageStreamSource As New FileStream("Logo1.png", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New PngBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)
Editor.DrawImage(bitmapSource.ToImageSource)

'Method 2
Editor.Position.Translate(0, 200)
Using source As FileStream = File.Open("Logo2.png", FileMode.Open)
    Dim imageSource As New Resources.ImageSource(source)
    Editor.DrawImage(imageSource)
End Using

'Method 3
Editor.Position.Translate(0, 400)
Dim bitmap As New BitmapImage()
bitmap.BeginInit()
bitmap.UriSource = New Uri("Logo3.png")
bitmap.EndInit()
Editor.DrawImage(bitmap.ToImageSource)

Dim filename As String = "test.pdf"
Using DocStream As New FileStream(filename, FileMode.Create)
    FormatProvider.Export(Document, DocStream)
End Using

-----------------------------------

Any advice would be very much appreciated. I am finding the RadPDFProcessing tool extremely useful in a dynamic product brochure project i am working on but i need to be able to use transparent images. If its not possible to use a PNG file is the another file format i could import to the PDF that allows for transparency?




Kammen
Telerik team
 answered on 05 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?