Afegir chequeig extensio .pdf
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<TabItem Header="Merge PDF">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Button x:Name="AfegirPdf" Content="Afegir Fitxers" Margin="0,10,0,10" Height="30" Width="180" HorizontalAlignment="Center" Click="SelectOpenFile_Button_Click"/>
|
||||
<Button x:Name="AfegirPdf" Content="Afegir Fitxers" Margin="0,20,0,10" Height="30" Width="180" HorizontalAlignment="Center" Click="SelectOpenFile_Button_Click"/>
|
||||
<ListView x:Name="MyListView" Height="190" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<!-- OnMouseOver and IsSeleected hidden effects-->
|
||||
<ListView.ItemContainerStyle>
|
||||
|
||||
@@ -104,6 +104,10 @@ namespace UtilitatPdf
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetExtension(FinalPdfFile) != ".pdf")
|
||||
{
|
||||
FinalPdfFile += ".pdf";
|
||||
}
|
||||
FileInfo currentFile = new FileInfo(FinalPdfFile);
|
||||
if (currentFile.Exists) File.Delete(FinalPdfFile);
|
||||
if(list.Count == 1)
|
||||
@@ -145,6 +149,12 @@ namespace UtilitatPdf
|
||||
}
|
||||
else
|
||||
{
|
||||
if (File.Exists(InSignFile.Text))
|
||||
{
|
||||
if(Path.GetExtension(OutSignFile.Text) != ".pdf")
|
||||
{
|
||||
OutSignFile.Text += ".pdf";
|
||||
}
|
||||
if (ManipulatePdf(InSignFile.Text, OutSignFile.Text))
|
||||
{
|
||||
InSignFile.Text = string.Empty;
|
||||
@@ -152,6 +162,11 @@ namespace UtilitatPdf
|
||||
MessageBox.Show("S'ha ocultat el Cif/Nif de les signatures del document.", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("L'arxiu: "+ InSignFile.Text + " No Existiex.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region File Dialogs
|
||||
@@ -240,7 +255,7 @@ namespace UtilitatPdf
|
||||
|
||||
PdfFormXObject form = new PdfFormXObject(new Rectangle(annotationRect.ToRectangle()));
|
||||
Canvas canvas = new Canvas(form, pdfDocument);
|
||||
canvas.Add(CreateNewCell(cleanRegex.Replace("\n", "").Replace("\r", "")).SetFontSize(7));
|
||||
canvas.Add(CreateNewCell(cleanRegex));
|
||||
|
||||
pdfWidgetAnnotation.SetNormalAppearance(form.GetPdfObject());
|
||||
}
|
||||
@@ -261,7 +276,8 @@ namespace UtilitatPdf
|
||||
private static Cell CreateNewCell(string texto)
|
||||
{
|
||||
Cell celda = new Cell();
|
||||
Paragraph p = new Paragraph(texto);
|
||||
texto = texto.Replace("\n", "").Replace("\r", "");
|
||||
Paragraph p = new Paragraph(texto).SetFontSize(7);
|
||||
celda.Add(p);
|
||||
return celda;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user