PDF for WinRT
Step 1 of 4: Creating an Application with C1PdfDocument Object

In this step, you'll create a Windows Store application and add a C1PdfDocument object.

  1. In Visual Studio, select File | New | Project.
  2. In the New Project dialog box, select a language in the left pane, and in the templates list select Windows Store Application. Enter a Name for your project and click OK. The New Windows Store Application dialog box will appear.
  3. Click OK to close the New Windows Store Application dialog box and create your project.
  4. Right-click the project name in the Solution Explorer and select Add Reference.
  5. In the Add Reference dialog box, locate and select the C1.Xaml.Pdf.dll and click OK to add the reference to your project.
  6. Place your cursor just before the <Grid> </Grid> tags on your MainPage.xaml file. Add the following markup to create your page resources:
XAML
Copy Code
<Page.Resources>
    <Style TargetType="PdfViewer:C1PdfViewer">
        <Setter Property="Background" Value="Gray" />
        <Setter Property="BorderThickness" Value="0" />
    </Style>
</Page.Resources>
  1. Place your cursor between the <Grid> tags. Add the following markup to create a C1PdfViewer control:
XAML
Copy Code
<PdfViewer:C1PdfViewer Name="c1PdfViewer1" Grid.Row="1"/>
  1. Then add the markup for a general ProgressRing control and a general Button control. This markup also adds a Click event so you can save your PDF document:
XAML
Copy Code
<ProgressRing x:Name="progressRing" Grid.Row="1"/>
<Button x:Name="btnSave"  Content="Save PDF" Click="btnSave_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 0 10" Height="40" Width="106"/>

 

In this step, you created a Windows Store application, added references, and added control to the application. In the next step, you'll add code to your application to create your PDF document. 

 

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback