For production PDF creation convert Figures to GIF before creating a PDF. TIF background was set to transparent, and was creating a Black Box when PDF/A format was created with MSWord.
Added MyGIFFile property to RoImageFile, so that the file could be deleted if it is created during the PDF creation process for MSWord sections.
This commit is contained in:
1 parent
3156c8b7b9
commit
126b8f1878
2 files changed
+21
-1
No files matched your search
@@ -845,7 +845,19 @@ namespace VEPROMS.CSLA.Library
|
||||
// 9.25 is the approximate offset of the base line of the font, i.e. doesn't include descender.
|
||||
float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary) + ((sel.Font.Size * 9.25F) / 12);
|
||||
sel.Text = "";
|
||||
LBShape shape = myDoc.Shapes.AddPicture(roImageFile.MyFile.FullName, x, y, sel.Range);
|
||||
LBShape shape = null;
|
||||
if (MSWordToPDF.DebugStatus==0 && !roImageFile.MyFile.FullName.ToUpper().EndsWith("GIF"))
|
||||
{
|
||||
System.Drawing.Image img = System.Drawing.Image.FromFile(roImageFile.MyFile.FullName);
|
||||
string newname = Regex.Replace(roImageFile.MyFile.FullName,@"\.[A-Z]+$",".GIF");
|
||||
roImageFile.MyGifFile = new FileInfo(newname);
|
||||
img.Save(newname, ImageFormat.Gif);
|
||||
shape = myDoc.Shapes.AddPicture(newname, x, y, sel.Range);
|
||||
}
|
||||
else
|
||||
{
|
||||
shape = myDoc.Shapes.AddPicture(roImageFile.MyFile.FullName, x, y, sel.Range);
|
||||
}
|
||||
shape.RelativeVerticalPosition = LBWdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;
|
||||
shape.Top = y; // Reset value after setting flag RelativeVerticalPosition
|
||||
shape.RelativeHorizontalPosition = LBWdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;
|
||||
|
||||
Reference in new issue
Block a user