|
|
|
|
|
I am trying to draw up a simple app to show how to change the font size of a PdfTextObject. What I have thus far: Code: public partial class Form1 : Form
{
public Form1()
{
PdfCommon.Initialize("");
InitializeComponent();
}
private void BtnLoad_Click(object sender, EventArgs e)
{
using (OpenFileDialog ofd = new OpenFileDialog
{
AutoUpgradeEnabled = true,
CheckFileExists = true,
CheckPathExists = true,
ReadOnlyChecked = true,
DefaultExt = "pdf",
DereferenceLinks = true,
SupportMultiDottedExtensions = true,
ShowHelp = false,
Multiselect = false,
ShowReadOnly = false,
Title = "Please select a PDF file."
})
{
DialogResult dr = ofd.ShowDialog();
if ((dr == DialogResult.Yes) || (dr == DialogResult.OK))
{
PdfDocument doc = PdfDocument.Load(ofd.FileName, new PdfForms());
doc.Pages[0].PageObjects.OfType<PdfTextObject>().First().FontSize += 20;
doc.Save(@"C:\temp\Output.pdf", SaveFlags.RemoveUnusedObjects);
}
}
}
}
This is just a rough draft, obviously - no error checking, etc. The point is, when I get down to line 30, I can see the FontSize property of that particular object does in fact change. And when I look at the two PDF's (source and saved) they are in fact different file sizes. But physically, when I open the output file, I see no difference in that PdfTextObject at all. I've also tried changing the matrix, and also am unable to change the output's appearance. Am I just taking the wrong approach here?
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close