1 2 Previous Next 24 Replies Latest reply on Jun 9, 2015 2:30 PM by smith7180

    Dramatically Reduced PDF sizes in FMP14?

    smith7180

      One of the many things on my to do list was to reduce the size of the image heavy pdf's my database has to create.  I'd already tested and was satisfied with using the get thumbnail function to generate temporary images for the pdf.

       

      However now that I've returned to the issue to implement the change, I can't seem to reproduce the problem.  All my pdf's seem to be reduced in size by about 1/6th.  Anyone else seeing anything similar?  It's certainly a welcome change, but I'm worried I'm just missing something.

        • 1. Re: Dramatically Reduced PDF sizes in FMP14?
          dmb_fmp

          I am seeing something similar with FMPA 13 and FMS 14. I have downloaded FMPA 14, but not yet installed it yet...I'm waiting...not sure exactly what for, but waiting. In any event, though my input may not be exactly on point, I have had what may be a similar experience.

           

          My focus over the past couple of weeks has been transitioning from FMS 13 up to FMS 14 with a PDF-centric database I designed with FMPA 13, and I've recently had a few discussions about PDFs and their FM generated thumbnails. (for more info, see Re: Disable Thumbnail Generation & Re: FMS 14 WebDirect PDF Resolution Issue in Static-Content Container).

           

          I would say the one pitfall to watch out for is that if you use FMS 14 WebDirect to display your PDFs in static-content containers, your PDFs (or more likely their FM generated thumbnails) may be displayed to the end user with unsatisfactory resolution.

           

          Let me ask a couple of clarifying questions though - I'd really like to understand your situation better:

          smith7180 wrote:

           

          One of the many things on my to do list was to reduce the size of the image heavy pdf's my database has to create. 

          What do you mean when you say that your "database has to create" them? The only PDFs my databases have to create are when generating reports, so I'm curious if that's what you're talking about or if it's something else.


          When it comes to thumbnails, FMPA 13 natively generates both a JPG & PNG image for each PDF in a container (if it's a multi-page PDF, FMPA 13 simply generates a JPG image & a PNG image of the PDF's 1st page only). Using the GetThumbnail function, FMPA 13 generates only the JPG image.

           

          For example, if I insert ORIGINAL.pdf into a container, FMPA 13 generates the thumbnails ORIGINAL.jpg and ORIGINAL.png; using the GetThumbnail(ORIGINAL.pdf;"height";"width") generates ORIGINAL.jpg.

           

          Does FMP 14 generate PDF thumbnails for PDFs? Does GetThumbnail(ORIGINAL.pdf;"height";"width") generate ORIGINAL.pdf of your preferred "height" and "width"?

           

          smith7180 wrote:

           

          I'd already tested and was satisfied with using the get thumbnail function to generate temporary images for the pdf.

          This seems pretty straight forward. In my experience with FMPA 13, the GetThumbnail function for PDFs returns a JPG image. One of the properties of the user-generated JPG thumbnail that FM does not allow the user to control is the JPG's DPI/PPI. For me, FMPA 13 returns JPG images with 72 DPI.

           

          Are you having the same results with FMP 14?

           

          This was the root of some FMS 14 WebDirect trouble for me - when it came to JPG thumbnails, I needed JPG images with 150 PPI.

           

          smith7180 wrote:

           

          However now that I've returned to the issue to implement the change, I can't seem to reproduce the problem.

          What is the "problem" you are trying to reproduce? I think the problem is that FMP 14 was generating PDFs for you that had a cumbersome file size. Is that correct? If so, I imagine the answer to my earlier question about what you mean by your "database has to create" the PDFs will shed some light on this.

           

          smith7180 wrote:


          All my pdf's seem to be reduced in size by about 1/6th.

          Are you saying that when you insert a 6 MB PDF into a container, FMP 14 stores it for you as a 5 MB PDF with no noticeable loss in resolution or any other quality? If not, what do you mean?

          • 2. Re: Dramatically Reduced PDF sizes in FMP14?
            monkeybreadsoftware

            Do you guys have test cases?

             

            With our MBS Plugin we can render preview pictures ourselves and have full control about parameters like the resolution.

            In general the picture presented to user should have at least resolution of screen, so the user doesn't see any compression or low resolution artifacts.

            • 3. Re: Dramatically Reduced PDF sizes in FMP14?
              smith7180

              Sorry I was in a bit of a hurry so I did a really bad job of describing my issue.  My database manages inventory.  Sometimes the users needs to generate a pdf list of selected inventory.  This list includes a picture of each item.

               

              So the users is looking at the inventory screen and presses the 'PDF' button.  All the inventory info is then placed in temporary fields (including the image).  The user is then taken to a new layout that looks like a PDF (but is in fact a layout).  All the relevant inventory info is displayed on this layout, but in the temp fields so that the users may edit and tweak all the data non-destructively.  Once everything is displayed to the his/her liking, the users presses the 'finish' button, and the database exports to PDF.

               

              In FM13 these resultant PDF's were too large (too many MB's).  The images on the PDF are quite small relative to the the resolution of the image in the database, so my solution to reduce the PDF size was to use the 'get thumbnail' function to insert smaller images into the aforementioned temporary image field.  This solved my problem completely.  However I only tested the technique, I never actually implemented it.

               

              Along comes FMA14, and much to my pleasant surprise, the exported PDF's are much smaller.  A PDF that was 1.2 MB is now 0.2MB - 0.3MB.  This is about what I could achieve with the 'get thumbnail' approach.  I can of course get even smaller with the 'get thumbnail' function, but if I do I begin to notice a loss in image quality.  It's as if FMP recognizes that image is higher res than is need for it's size on the page and reduces it.

               

              I just upgraded FMA14- I didn't make any other changes to this aspect of the database.


              Thanks!

              • 4. Re: Dramatically Reduced PDF sizes in FMP14?
                dmb_fmp

                Ok - I think I got it. Sounds interesting. One new clarifying question:

                 

                smith7180 wrote:


                Once everything is displayed to the his/her liking, the users presses the 'finish' button, and the database exports to PDF.

                When you say "exports to PDF", what do you mean? I think it means FM takes your layout that looks like a PDF and saves it as an actual PDF using the FM Save as PDF function. Is that right?

                ---

                Another question I have is about one of the properties of your resulting PDFs. What does it list as the "PDF Producer"? With FMPA 13, the PDFs FM creates for me show PDF Producer as Adobe PDF Library 10.1.

                 

                Screen Shot 2015-06-07 at 11.05.47 AM.png

                 

                I ask for a couple reasons. First, with the FMPA 13 "Invoices" starter solution, I've had trouble with invoices I save as PDFs. When opening the saved PDFs, they appear blank on all of the Adobe applications with which I've tried viewing them. They appear normal using other PDF viewers, such as Apple's Preview...just not Adobe viewers (Acrobat 9, 10; Reader 10, 11).

                 

                Second, I'm curious if FM 14 uses a different PDF Producer. (Though a more appropriate question - that might belong in its own thread - may be whether FM allows the user any choice with regard to PDF Producer).

                • 5. Re: Dramatically Reduced PDF sizes in FMP14?
                  smith7180

                  Yeah- the 'save records as pdf' step.  I've never had an issue with viewing pdf's in acrobat or either OS's document viewer. 

                   

                  PDF properties.jpg

                  • 6. Re: Dramatically Reduced PDF sizes in FMP14?
                    dmb_fmp

                    Christian Schmitz wrote:

                     

                    Do you guys have test cases?

                    Perhaps I do - or could provide one. Is all you need a FMPA 13 solution to upload to FMS 14 all you need? This would only be to test the pitfall I referred to: that if you use FMS 14 WebDirect to display your PDFs in static-content containers, your PDFs (or more likely their FMPA 13 generated thumbnails) may be displayed to the end user with unsatisfactory resolution.

                    Christian Schmitz wrote:

                     

                    With our MBS Plugin we can render preview pictures ourselves and have full control about parameters like the resolution.

                    Do you have control over the DPI/PPI?

                    Christian Schmitz wrote:

                     

                    In general the picture presented to user should have at least resolution of screen, so the user doesn't see any compression or low resolution artifacts.

                    I'm not sure I understand this statement... I think it might mean that if you size the thumbnail appropriately, DPI/PPI may be less of a factor in the overall quality of the image presented to the end user. Do I understand correctly?

                    • 7. Re: Dramatically Reduced PDF sizes in FMP14?
                      monkeybreadsoftware

                      Maybe you can show me the problem with screenshots, sample files or sample database?

                      • 8. Re: Dramatically Reduced PDF sizes in FMP14?
                        jrenfrew

                        There are lots of reasons that the resulting PDF is smaller (for example proper use of the internal dictionaries to point to multiple copies of the same graphic in the file)

                         

                        You will need to do much more testing to know where the saving might be coming from. And the though of some software making arbitrary decisions about the component parts I use to assemble the finished thing - makes me shiver.

                         

                        MUCH better to store the original images a the size that you need for the desired output in the first place.

                        • 9. Re: Dramatically Reduced PDF sizes in FMP14?
                          electon

                          I notice a small change in file size.

                          Same pdf

                          13: 250614

                          14: 231690

                          14 creates about 92% of the size of 13

                          It might depend on text / graphics ratio, number of pages.

                          Producer seems to be the same in both versions:

                          Adobe PDF Library 10.1

                          • 10. Re: Dramatically Reduced PDF sizes in FMP14?
                            dmb_fmp

                            Ok - attached is a sample database I created with FMPA 13, ready to upload to FMS 14. It has 1 field, 1 layout, & 1 record. If you upload to FMS 14 and look at the record via WebDirect, please let me know your thoughts about the image quality presented.

                            • 11. Re: Dramatically Reduced PDF sizes in FMP14?
                              electon

                              The resolution is indeed not that impressive. Your pdf gets down-converted  from 1,3 Mb to 355.17 KB on the page.

                               

                              I think it's actually a good thing performance wise. That's how photo galleries are done on the web.

                              The fact that the thumbnail is blown up to full screen makes it look odd.

                              The way I would implement it is make a smaller size preview container ( the image will look better ) and provide navigation to a layout where the container is in interactive mode. That looks sharp since is downloaded as is.

                               


                              • 12. Re: Dramatically Reduced PDF sizes in FMP14?

                                FileMaker Server now reduces the image size to fit the alloted space on a layout. In other words a 5 Megabyte image stored on server is reduced to a 100 x 100 thumbnail before being sent over the web to fit in a 100 x 100 pixel image size on a layout. I tested this and determined that there was no longer any need to create a separate thumbnail container in the record. Of course there may be other reasons for doing so such as reducing the total size of a file if it is emailed to someone.

                                 

                                So, it seems logical that in saving the record(s) to PDF that FileMaker Server would send a smaller size image to the layout and thus to the PDF.

                                 

                                Since this wasn't true in earlier versions the full size image would have been sent by Server and thus the larger file size of the PDF.

                                 

                                You no longer need to create thumbnail containers since FileMaker will do all of the work for you at the Server level.

                                 

                                I remember seeing many centuries ago in a land far away how one program, Kodak I think, created packets of data for the images. The small image pixels, then a packet of pixels for the next size and a packet of pixels for the next six. So the small image could be created quickly. One twice as large would also use the next packet, and so on. I think FileMaker Server is now using a similar technique and only sending the packets needed for our layouts.

                                • 13. Re: Dramatically Reduced PDF sizes in FMP14?
                                  dmb_fmp

                                  The resolution is indeed not that impressive. Your pdf gets down-converted  from 1,3 Mb to 355.17 KB on the page.

                                   

                                  I think it's actually a good thing performance wise.

                                  I too see the value in it. I would agree that FM generating its own thumbnail images by default for all image type files (except JPGs) is indeed a valuable feature.


                                  However, it would also be valuable if FM allowed for disabling thumbnail generation under certain circumstances, such as when image load time is less important than maximizing (1) server storage space & (2) the resolution of the image presented to the end user.

                                  The way I would implement it is make a smaller size preview container ( the image will look better ) and provide navigation to a layout where the container is in interactive mode.

                                  I also see value in looking for a workaround, and the one you propose may be ideal under most circumstances.


                                  But have you tried thinking of a set of conditions under which what you propose would not be a viable option? We can use the image contained in the test case I uploaded as one example. That image is a handwritten index page that the end user needs to (A) be able to read clearly, but (B) never be allowed to download.


                                  With the proper settings, an interactive container may seems like a great option. It would solve one issue easily: to prevent the user from downloading the image, you could simply disable field entry in browse mode.


                                  But to maximize image legibility, you would likely have to rely on FM's "enlarge image to fit" to provide the equivalent of Apple Preview's "single-page continuous" or Adobe's "fit to window width and enable scrolling". If your image is a JPG, that would likely work. However, if your image is a PDF, it may not (see Re: Interactive Containers with PDFs for a "Reduce or Enlarge Image to Fit" discussion that, in my experience, applies to "Enlarge Image to Fit" as well).


                                  What would you do?

                                  • 14. Re: Dramatically Reduced PDF sizes in FMP14?
                                    dmb_fmp

                                    I've never had an issue with viewing pdf's in acrobat or either OS's document viewer.

                                    Me neither, until last week when I decided to use FMPA 13's "Invoice" starter solution to invoice a client for services that had a lot to do with PDF mastery & such. It was a bit embarrassing when the client called indicating his invoice appeared completely blank when tried to view it.

                                     

                                    Attached is an FMPA 13 "Invoice" starter solution that I've altered in no way other than to create a sample invoice. If you select the sample invoice, then click the "Print Invoice" button on the top right, and then select "Save as PDF" while in preview mode, what happens when you try to view the resulting invoice.pdf with an Adobe viewer?

                                    1 2 Previous Next