excel修改事实打印预览_Excel图像预览后更改大小

excel修改事实打印预览

I ran into an odd problem with images in Excel 2010 last week – after looking at the sheet in Preview, a small logo graphic grew big enough to cover the most of the data on the sheet! Have you run into the problem where Excel images change size after Preview?

上周,我在Excel 2010中遇到了一个图像奇怪的问题-在“预览”中查看工作表后,一个小的徽标图形变得足够大,可以覆盖工作表中的大部分数据! 您是否遇到过预览后Excel图像更改大小的问题?

之前和之后 (Before and After)

Here’s how my company logo image looked before the Preview – just a nice, small-sized logo, at the top left of the sheet.

这是预览之前我的公司徽标图像的外观–表格左上方只是一个漂亮的小型徽标。

imagepreviewsize02

Here is a screen shot of the logo image after the Preview. That is not what I wanted it to look like!

这是预览后徽标图像的屏幕截图。 那不是我想要的样子!

imagepreviewsize01

检查图片设置 (Check the Picture Settings)

The first thing I did was check the picture settings – right-click on the picture, and click Size and Properties

我要做的第一件事是检查图片设置–右键单击图片,然后单击“大小和属性”

imagepreviewsize03

Then, in the Properties category, make sure the image is set to “Don’t move or size with cells.”

然后,在“属性”类别中,确保将图像设置为“不要移动或调整单元格大小”。

imagepreviewsize04

That setting was okay, so I didn’t know why the size changed. I Googled, but that didn’t help – the only suggestions were to check the image properties.

那个设置还可以,所以我不知道为什么尺寸改变了。 我用Google搜索,但这没有帮助-唯一的建议是检查图像属性。

粘贴到新图片中 (Paste in a new picture)

There was a copy of the logo on another sheet in the file, so I deleted the oversized one, and pasted in a new copy.

文件的另一张纸上有徽标的副本,因此我删除了超大的徽标,然后粘贴到新副本中。

Yikes! The new copy looked just as big as the oversized one, even though it was the correct size on the sheet where I’d copied it.

kes! 新副本看起来和超大副本一样大,即使它是我复制纸张的正确尺寸。

imagepreviewsize01

I tried deleting and copying a few more times, and the result was the same each time. Also, I found that the problem occurred whether I manually opened the Print Preview window, or used VBA to open it.

我尝试了几次删除和复制,每次的结果都是相同的。 另外,我发现无论是手动打开“打印预览”窗口还是使用VBA来打开它,都会出现问题。

消失的画面 (The Disappearing Picture)

Finally, I noticed something odd, as I pasted the logo onto the problem sheet – after I pasted, I had to zoom out a bit, to find the pasted picture.

最终,当我将徽标粘贴到问题表上时,我发现了一些奇怪的地方–粘贴后,我不得不缩小一点以找到粘贴的图片。

When I could see the pasted picture, it was the right size, instead of oversized. But, it was in the range of cells where it should have been visible, without zooming.

当我看到粘贴的图片时,它是正确的尺寸,而不是过大的尺寸。 但是,它应该在不缩放的情况下在单元格范围内可见。

The picture disappeared after pasting, and only appeared when I zoomed. This was getting stranger and stranger!

图片在粘贴后消失了,仅在缩放后才出现。 这越来越陌生了!

imagepreviewsize05

更改缩放 (Change the Zoom)

I tried previewing again, and the image got larger, just as it did before. But this time, I didn’t delete the picture, I just increased the zoom level, from 100% to 110%. The picture immediately went back to the correct size, and stayed that size, when I put the zoom back to 100%.

我再次尝试预览,图像变大了,就像以前一样。 但是这次,我没有删除图片,只是将缩放级别从100%增加到110%。 当我将缩放比例放回100%时,图片立即回到正确的尺寸,并保持该尺寸。

I don’t know why the problem occurred, but I added a bit of code to the project, to increase the zoom level, then set it back to the previous zoom setting.

我不知道为什么会出现此问题,但是我向项目添加了一些代码,以提高缩放级别,然后将其设置回先前的缩放设置。

Here is the code that I used, just in case you run into a similar problem.

这是我使用的代码,以防万一您遇到类似的问题。

    lZoom = ActiveWindow.Zoom
    ActiveWindow.Zoom = lZoom + 10
    ActiveWindow.Zoom = lZoom

And if you’ve ever run into this, and know what causes the oversized images, please let me know!

如果您曾经遇到过这种情况,并且知道是什么原因导致图像过大,请告诉我!

翻译自: https://contexturesblog.com/archives/2014/03/25/excel-images-change-size-after-preview/

excel修改事实打印预览

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: POI(Poor Obfuscation Implementation)是一个开源的Java类库,用于处理Microsoft Office格式的文档,如Word、Excel和PowerPoint。然而,POI并不直接支持PDF文件的预览和转换,因为PDF文件属于Adobe的专有格式。 要在Java中实现PDF预览和转换,可以使用其他的开源库,如Apache PDFBox或iText。Apache PDFBox提供了处理PDF文件的功能,包括预览、提取文本、提取图像等。iText则提供了PDF文档的创建、修改和转换功能。 使用Apache PDFBox预览PDF文件时,可以使用PDFRenderer类来将PDF文件渲染成图像,然后将图像显示在用户界面上。此外,PDFBox还提供了一些其他的工具方法,如提取文本、切割页面、合并多个PDF文件等。 要将PDF文件转换为文档预览,可以使用iText库。iText提供了将PDF文件转换成其他格式(如文本、HTML、图像)的功能。可以使用PdfReader类读取PDF文件,然后使用PdfDocument类将其转换成所需的格式,并保存到文件或以流的形式输出。 综上所述,POI库本身不支持PDF文件的预览和转换,但可以通过使用其他的开源库,如Apache PDFBox或iText,来实现这些功能。这些库提供了对PDF文件的处理和转换的API,可以方便地在Java中实现PDF的预览和转换。 ### 回答2: POI(即Apache POI)是Java编程语言的开源库,用于处理各种Office文档格式。它包括对Word、Excel和PowerPoint等文件的读写操作。然而,POI本身不支持直接预览PDF文件。 要在Java预览PDF文件,我们可以借助第三方库或工具。其中一种常用的选择是使用Apache PDFBox。 Apache PDFBox是一个功能强大的Java库,用于处理和操作PDF文件。它提供了许多功能,包括读取、写入和编辑PDF文件,以及提取文本、图像和元数据等。 要使用Apache PDFBox预览PDF文件,我们可以通过以下步骤实现: 1. 使用PDFBox库加载PDF文件。我们可以使用`PDDocument.load()`方法来加载指定路径下的PDF文件。 2. 获取PDF页面数。通过使用`getNumberOfPages()`方法,我们可以获得PDF文件中的页面总数。 3. 选择要预览的页面。我们可以使用`getPage(int pageNumber)`方法获取指定页码的页面内容。 4. 将页面内容转换为图像。PDF页面必须先转换为图像才能在Java应用程序中进行预览。我们可以使用`PDFRenderer`类的`renderImage(int pageIndex)`方法将页面渲染为图像。 5. 将图像显示在Java应用程序中。我们可以使用Java图形库(如AWT或JavaFX)的API来显示图像,并以预览方式呈现PDF内容。 通过这些步骤,我们可以使用POI和PDFBox这两个开源库来实现在Java应用程序中预览PDF文件。这样,我们可以读取PDF文件的内容,并将其在应用程序中以图像的形式显示,以达到预览的效果。 ### 回答3: POI(Poor Obfuscation Implementation)是一个Java开发库,用于处理各种办公文档,如Microsoft Office(包括Word、Excel和PowerPoint)和Adobe PDF文件。而预览PDF文件和转换为文档预览是POI库的其中一个功能。 在使用POI预览PDF文件时,首先需要引入POI的相关依赖包,并在代码中创建一个PDF文档的输入流。然后,使用POI提供的API,将输入流加载到POI的对象中。接下来,可以通过遍历PDF页面,将页面的内容提取出来进行展示。这样就可以实现PDF文件的预览功能。 转换为文档预览是指将PDF文件转换为其他格式的文档,并进行预览展示。POI库提供了一些转换功能,可以将PDF文件转换为其他格式的文档,如Word文档或HTML文件等。具体的转换过程类似于预览功能,需要加载PDF文件并进行内容提取和格式转换。 POI库是一个功能强大的处理办公文档的工具,可以方便地进行PDF文件的预览和转换为其他格式的文档。它不仅提供了对PDF文件的读取和写入功能,还支持对PDF文件的内容提取、文本搜索、页面拆分等操作。无论是需要进行PDF文件的预览,还是将PDF文件转换为其他格式的文档,使用POI库都能轻松地实现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值