Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сохраняет только одно изображение из документа #4

Closed
teplofizik opened this issue Jun 19, 2023 · 3 comments

Comments

@teplofizik
Copy link

teplofizik commented Jun 19, 2023

Добавляю несколько изображений в цикле, как это сделано в тесте библиотеки, но все картинки отображаются только как первая. В архиве они есть, но в document.xml.rels тоже только первая.

foreach (var A in Doc.Attachments)
{
    if (A.AType == Types.AttachmentType.Photo)
    {
        var Photo = A as Types.Attachment.Photo;
        var image = document.AddImage(new System.IO.MemoryStream(Photo.Data), Wordroller.Content.Images.KnownImageContentTypes.Jpg);
        var picture = section.WrapImageIntoInlinePicture(image,
                                                         $"{Photo.Id}",
                                                         Photo.Text,
                                                         300,
                                                         Photo.GetHeight(300));

        var paragraph = section.AppendParagraph();
        paragraph.AppendPicture(picture);
    }
    else
    {
        var paragraph = section.AppendParagraph();
        paragraph.AppendText(A.ToString());
    }
}
@teplofizik
Copy link
Author

Версия 1.1.0 из NuGet

shestakov pushed a commit that referenced this issue Jun 21, 2023
- Fixing Fooder.GetMaxDrawingId() and DocumentBody.GetMaxDrawingId();
- Fixing DocumentContentContainer.EnsureImageRelationship();
- Updating ImageTests to ensure multiple images are added correctly (issue #4).
@shestakov
Copy link
Owner

Hi @teplofizik!

Confirmed. Fixed. Published. Embarrassed.

Check version 1.1.1 pls.

@teplofizik
Copy link
Author

Спасибо! Теперь всё как надо!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants