Answer the question
In order to leave comments, you need to log in
Which parameter in PDF is responsible for indenting from the edge of the page?
Created two PDF files in Word.
In one PDF I set the left margin more, in the other - less.
When viewing, you can see that the fields are different, but how to find the sizes of the fields programmatically?
I'm trying to display the sizes of ArtBox, BleedBox, CropBox, MediaBox, TrimBox and Rect, but they are the same in both documents.
Answer the question
In order to leave comments, you need to log in
I haven't found a way to determine the margins for two years, except to render to an image and search from each edge to the first non-white dot.
as of 11/02/2019 19:25 Moscow time we have
a question
Which parameter in PDF is responsible for indenting from the edge of the page?
Created two PDF files in Word.
In one PDF I set the left margin more, in the other - less.
When viewing, you can see that the fields are different, but how to find the sizes of the fields programmatically?
I'm trying to display the sizes of ArtBox, BleedBox, CropBox, MediaBox, TrimBox and Rect, but they are the same in both documents.
C#
mentioned only in the tag OpenXML SDK
not mentioned at all C#
, you can suggest creating your documents programmatically in the Word, editing the page parameters in the same place, and then saving to pdf. I think it should take much less than two years to study the task of managing page parameters in Word, internal static bool wordAsConverter(string rtf, string pdf, bool verb = true, bool clean = true)
{
$"\t..try convert to pdf...".print();
var res = false;
var app = new Application();
try
{
var doc = app.Documents.Open(rtf);
doc.ExportAsFixedFormat(pdf, WdExportFormat.wdExportFormatPDF);
doc.Close(false);
res = true;
var fn = Path.GetFileName(rtf);
if (verb) $"\t{fn} converted to pdf".print();
if (clean)
{
File.Delete(rtf);
if (verb) $"\t{fn} deleted".print();
}
}
catch (Exception e) { e.Message.print(); }
finally { app.Quit(false); }
return res;
}
// что бы не смущал .print(); это уже привычка, для уменьшения многословности кода
internal static void print(this string s) => Console.WriteLine(s);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question