question

MarcAl-4899 avatar image
0 Votes"
MarcAl-4899 asked emizhang-msft edited

Export to PDF from Word365 wrong for some pictures (not all)

Hello,

I have a software that fills some datas in word (via mailmerge).
The documents opens perfectly in Word but when I want to export it to PDF, the picture is wrong (a part of the picture is in the wrong part of the picture and the scale is wrong).
I have no problem using the Microsoft printer to PDF

Can someone please help me? What can I do? The picture is a WMF file.

Here is an example file with the problem

https://1drv.ms/w/s!AgP8E8OqJdIcjPRKoD7WwJPLyQ9VMA?e=FEsVes


Thank you
Marc


office-word-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcAl-4899 avatar image
0 Votes"
MarcAl-4899 answered

Hello,

I decided to use exactly the workaround I gave in the original message (print to PDF printer) (I am not a fan of buying a software (Acrobat) if I can do it with a PDF printer that works.
After that I have seen that If I use the parameter EmfType.EmfOnly with the line New Metafile(......
I have no problem with the exportation. There is only a problem with the quality of the picture that is "less good" than normal WMF.

Marc

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcAl-4899 avatar image
0 Votes"
MarcAl-4899 answered

Hello,
The Metafile is done in C#(that launches the mailmerge). The user of the document can resize the picture in the "base document" so with a png or a bitmap the picture has quality problems.
Is there something I can change here?
Thank you

Here is how I create my metafile
var PanelGraph = Graphics.FromImage(bp);
var _hdc = PanelGraph.GetHdc();
var _metaFile = new Metafile(astr_Graph, _hdc, new Rectangle(0, 0, bp.Width, bp.Height), MetafileFrameUnit.Pixel);
var CurGraph = Graphics.FromImage(_metaFile);
CurGraph.Clear(SystemColors.Window);
// Drawing inside the Metafile
DrawPosWithNewView (...........)
// End of drawing
CurGraph.Dispose();
_metaFile.Dispose();
PanelGraph.ReleaseHdc(_hdc);
PanelGraph.Dispose();
bp.Dispose();

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

emizhang-msft avatar image
0 Votes"
emizhang-msft answered

Hi @MarcAl-4899,
I downloaded your sample and export from Word to PDF and open the PDF file in Edge without problem picture:
105250-388.png

My Office 365 detail version number:
105197-389.png

What kind of browser did you use?
How did you open PDF file? From browser or PDF reader?
Try to install the latest updates for Office 365, and change the default browser.
Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





388.png (95.2 KiB)
389.png (5.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcAl-4899 avatar image
0 Votes"
MarcAl-4899 answered

Hello,

It is wrong in your picture. If you look at the green triangle, it is on the right in the word document while it is on the left in the png (and is is smaller than in the word document)
105370-image.png


And in your png

105467-image.png



Marc


image.png (50.8 KiB)
image.png (207.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcAl-4899 avatar image
0 Votes"
MarcAl-4899 answered emizhang-msft edited

Hello,

Yes, I guess I will have to force the use of the Microsoft printer and not export from word directly
Thank you
Marc

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is this the solution or workaround for your problem? If yes, you can try to accept it as an answer. Other partners who read the forums with the same issue can get more information from the correct result.

0 Votes 0 ·